Results for “Dates & time zones”
Small, practical examples. Search by task or narrow things down below.
Convert Unix seconds to an offset-aware timestamp
C#: DateTimeOffset preserves the UTC offset explicitly.
C#✓ Tested
Format a known UTC timestamp
Linux Commands: Use GNU date -u and an explicit input offset to avoid local timezone dependence.
Linux Commands✓ Tested
Format a UTC timestamp
Format a UTC timestamp using a complete Go program with explicit sample inputs.
Go✓ Tested
Parse a date without a time component
C#: DateOnly avoids attaching an irrelevant time or timezone to a calendar date.
C#✓ Tested
Sort timestamp strings by their parsed instants
JavaScript: Compare epoch values explicitly when date strings may contain different offsets.
JavaScript✓ Tested
Sort timestamp strings by their parsed instants
TypeScript: Compare epoch values explicitly when date strings may contain different offsets.
TypeScript✓ Tested
Advance a calendar date
Advance a calendar date using a complete Go program with explicit sample inputs.
Go✓ Tested
Convert Unix seconds to UTC
Convert Unix seconds to UTC using a complete Go program with explicit sample inputs.
Go✓ Tested
Display an instant at a fixed offset
Display an instant at a fixed offset using a complete Go program with explicit sample inputs.
Go✓ Tested
Find the weekday for a date
Find the weekday for a date using a complete Go program with explicit sample inputs.
Go✓ Tested
Measure a duration between instants
Measure a duration between instants using a complete Go program with explicit sample inputs.
Go✓ Tested
Parse a date with a Go layout
Parse a date with a Go layout using a complete Go program with explicit sample inputs.
Go✓ Tested