Results for “Dates & times”
Small, practical examples. Search by task or narrow things down below.
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
Parse a duration string
Parse a duration string using a complete Go program with explicit sample inputs.
Go✓ Tested
Round down to a whole minute
Round down to a whole minute using a complete Go program with explicit sample inputs.
Go✓ Tested
Convert Unix time to a timestamp
Interpret a seconds-since-epoch value as UTC.
unixepoch✓ Tested
Format a timestamp
Extract a year and month from ISO timestamp text.
strftime✓ Tested
Format a timestamp with to_char
Produce a fixed numeric date string.
to_char✓ Tested
Round a timestamp down to its month
Group dates by a calendar boundary.
date_trunc✓ Tested
Format a bounded duration as hours minutes and seconds
PowerShell: TimeSpan can format duration components with escaped separators.
PowerShell✓ Tested
Add an interval to a date
Perform calendar arithmetic with an interval literal.
INTERVAL✓ Tested
Blink the built-in LED three times
Alternate the built-in LED with a short blocking delay.
blink✓ Tested