Format the weekday name for a fixed UTC date.

weekday Weekday formatting is deterministic here because the timestamp and timezone are fixed.

Weekday Label

timestamp
weekday_label.lua
Replay: real traced execution (multi-file project)
local timestamp = 1704067200
local weekday = os.date("!%A", timestamp)
print("timestamp=" .. timestamp)
print("weekday=" .. weekday)
local timestamp = 1717200000
local weekday = os.date("!%A", timestamp)
print("timestamp=" .. timestamp)
print("weekday=" .. weekday)
local timestamp = 1735689600
local weekday = os.date("!%A", timestamp)
print("timestamp=" .. timestamp)
print("weekday=" .. weekday)
  1. timestamp ← 1704067200, weekday ← Monday

    1local timestamp→ 1704067200 = 1704067200 --@timestamp=1717200000, 17356896002local weekday→ Monday = os.date("!%A", timestamp1704067200)3print("timestamp=" .. timestamp1704067200)4print("weekday=" .. weekdayMonday)
    outputtimestamp=1704067200
    weekday=Monday
  1. timestamp ← 1717200000, weekday ← Saturday

    1local timestamp→ 1717200000 = 17172000002local weekday→ Saturday = os.date("!%A", timestamp1717200000)3print("timestamp=" .. timestamp1717200000)4print("weekday=" .. weekdaySaturday)
    outputtimestamp=1717200000
    weekday=Saturday
  1. timestamp ← 1735689600, weekday ← Wednesday

    1local timestamp→ 1735689600 = 17356896002local weekday→ Wednesday = os.date("!%A", timestamp1735689600)3print("timestamp=" .. timestamp1735689600)4print("weekday=" .. weekdayWednesday)
    outputtimestamp=1735689600
    weekday=Wednesday