FIND YOUR NEXT FEW LINES

Results for “Dates & time zones”

Small, practical examples. Search by task or narrow things down below.

293 snippets foundClear filters
GoDates & times

Parse a duration string

Parse a duration string using a complete Go program with explicit sample inputs.

Go✓ Tested
GoDates & times

Round down to a whole minute

Round down to a whole minute using a complete Go program with explicit sample inputs.

Go✓ Tested
SQLiteDates & time

Calculate whole days between dates

Subtract Julian day values for date-only inputs.

julianday✓ Tested
SQLiteDates & time

Convert Unix time to a timestamp

Interpret a seconds-since-epoch value as UTC.

unixepoch✓ Tested
SQL ServerDates & text

Count day boundaries between dates

Compare date values with DATEDIFF.

DATEDIFF✓ Tested
SQLiteDates & time

Format a timestamp

Extract a year and month from ISO timestamp text.

strftime✓ Tested
PostgresDates & series

Format a timestamp with to_char

Produce a fixed numeric date string.

to_char✓ Tested
PostgresDates & series

Round a timestamp down to its month

Group dates by a calendar boundary.

date_trunc✓ Tested
PowerShellFunctions & parameter validation

Accept one typed value at a time from a pipeline

PowerShell: An advanced function uses process to handle each pipeline item.

PowerShell✓ Tested
Arduino / CDigital input & output

Blink the built-in LED three times

Alternate the built-in LED with a short blocking delay.

blink✓ Tested
C#Dates & precise numbers

Calculate the number of calendar days between dates

C#: Subtract DayNumber values when the inputs are calendar dates.

C#✓ Tested
Arduino / CTiming & control

Compare elapsed time across timer rollover

Use unsigned subtraction when a millisecond counter wraps.

rollover✓ Tested