Time-stamp

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Time-stamp

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does a time-stamp on a transaction record show?
A The amount of money that was sent
B The date and time the record was made
2. When is the time-stamp added to a record?
A When the record is created
B Only after the record is deleted
3. Two transactions have different time-stamps. What can you work out from them?
A Which transaction happened first
B Which transaction was for more money
4. How do time-stamps help a ledger?
A They put the records in order
B They stop anyone from reading the records
5. A transaction was made at 14:32 on 3 March. Which part of the record is this?
A The sender's wallet
B The time-stamp

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1timestamp: 2026-02-03 14:05:09 ASORT records BY timestamp ASCENDING
2IF stamp_A < stamp_B THEN first ← A BThe date and time added to a record to show exactly when it was made
3A time-stamp is added when the record is created, so it shows when the transaction was made CThe transaction has no time-stamp, so nobody can tell when it was made or which happened first
4Sorting records by their time-stamps puts them in order, oldest first DComparing time-stamps to find which record happened first
5transaction ← {from: Ava, to: Liam, amount: 50} Erecord.timestamp ← NOW()
6timestamp: 2026-02-03 (date only) FA time-stamp must include the time as well as the date, otherwise two transactions on the same day cannot be put in order

Definitions

time-stamp

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
transaction.timestamp ← ___()
2.
IF t1.timestamp _ t2.timestamp THEN OUTPUT "t1 happened first" ENDIF
3.
SELECT * FROM ledger ORDER BY timestamp ___
4.
DECLARE timestamp : ____ timestamp ← NOW()
5.
newRecord ← CreateRecord(amount) newRecord._________ ← NOW() APPEND(ledger, newRecord)

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A timestamp ← "Alice"
B amount ← 25
C record ← [timestamp, amount]
D OUTPUT record
Question 2
A sender ← "Ava"
B receiver ← "Ben"
C amount ← 10
D timestamp ← NOW() + 7
E OUTPUT timestamp
Question 3
A FUNCTION AddRecord(amount)
B record.amount ← amount
C record.time ← "unknown"
D RETURN record
E ENDFUNCTION
Question 4
A timeA ← "09:15"
B timeB ← "09:20"
C IF timeA > timeB THEN
D OUTPUT "A happened first"
E ENDIF
Question 5
A timeA ← "10:05"
B timeB ← "10:02"
C IF timeB < timeA THEN
D OUTPUT "A was made first"
E ENDIF

Answer Key

Time-stamp
Section A: Quick Questions
Q1
B — The date and time the record was made
Q2
A — When the record is created
Q3
A — Which transaction happened first
Q4
A — They put the records in order
Q5
B — The time-stamp
Section B: Match the Pairs
Q1
timestamp: 2026-02-03 14:05:09 → The date and time added to a record to show exactly when it was made
Q2
IF stamp_A < stamp_B THEN first ← A → Comparing time-stamps to find which record happened first
Q3
A time-stamp is added when the record is created, so it shows when the transaction was made → record.timestamp ← NOW()
Q4
Sorting records by their time-stamps puts them in order, oldest first → SORT records BY timestamp ASCENDING
Q5
transaction ← {from: Ava, to: Liam, amount: 50} → The transaction has no time-stamp, so nobody can tell when it was made or which happened first
Q6
timestamp: 2026-02-03 (date only) → A time-stamp must include the time as well as the date, otherwise two transactions on the same day cannot be put in order
Section C: Definitions
Q1
time-stamp — The date and time added to a record when it is created, showing when it was made. It puts records in order and shows which happened first.
Section D: Fill in the Blanks
Q1
transaction.timestamp ← NOW()
Q2
IF t1.timestamp < t2.timestamp THEN OUTPUT "t1 happened first" ENDIF
Q3
SELECT * FROM ledger ORDER BY timestamp ASC
Q4
DECLARE timestamp : DATE timestamp ← NOW()
Q5
newRecord ← CreateRecord(amount) newRecord.timestamp ← NOW() APPEND(ledger, newRecord)
Section E: Spot the Error
Q1
A — A time-stamp must be the date and time the record was made, so it should be set with NOW(). A person's name is not a time-stamp.
Q2
D — The time-stamp must show exactly when the record was created. Adding 7 to it changes the time, so it should be timestamp ← NOW().
Q3
C — The time-stamp is added when the record is created and must hold the real date and time. It should be record.time ← NOW(), not the text "unknown".
Q4
C — The earlier time-stamp shows which record happened first. A (09:15) is earlier than B (09:20), so the test should be timeA < timeB.
Q5
D — The condition checks that B's time-stamp is earlier than A's, so B was made first. The output should say "B was made first".