Basic examples (2)
oDateTime = new stzDateTime([ :FromEpochSeconds = 1609459200 ]) ? oDateTime.ToString()
2021-01-01 00:00:00
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 62_example_1_from_epoch_seconds.ring(opens in a new tab)
oSingle = StzDateTimeQ("2024-03-15 03:05:00")
? oSingle.ToString12h()
? oSingle.ToStringXT("h:mm AP")2024-03-15 3:05:00 AM 3:05 AM
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 60_single_digit_hours.ring(opens in a new tab)
Scope (3)
oDateTime = StzDateTimeQ("2024-03-15 10:00:00")
oDateTime + 3600 # Add 3600 seconds (1 hour)
? oDateTime.ToString()2024-03-15 11:00:00
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 38_adding_seconds_directly_with_operator.ring(opens in a new tab)
oDateTime = StzDateTimeQ("2024-03-15 14:30:45")
? oDateTime.ToStringXT("dd/MM/yyyy h:mm AP")
? oDateTime.ToStringXT("MM-dd-yyyy h:mm:ss AP")
? oDateTime.ToStringXT("dddd h:mm AP")15/03/2024 2:30 PM 03-15-2024 2:30:45 PM Friday 2:30 PM
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 51_custom_12-hour_format_strings.ring(opens in a new tab)
oMorning = StzDateTimeQ("2024-03-15 09:15:30")
? oMorning.ToSimple()
? oMorning.ToSimple12h()
? oMorning.ToSimple24h()
? oMorning.ToStringXT("h:mm AP")15/03/2024 9:15 AM 15/03/2024 9:15 AM 15/03/2024 09:15 9:15 AM
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 52_morning_times_am.ring(opens in a new tab)
The extensions of this method
Each extension, and whether it exists for this method; an extension that exists combines with the others (FindSTCS).
Every example is a test file of the library, run inside the library for this page; only those whose output kept every promise their file wrote are shown.
See also
- The class stzDateTime
- The area's reference: Internationalization
- The other methods in these examples: stzDateTime.ToSimple · stzDateTime.ToSimple24h · stzDateTime.ToString12h

