FIND YOUR NEXT FEW LINES

Results for “Dates & times”

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

126 snippets foundClear filters
C#Data & dates

Add calendar days

Use DateOnly for a date without a time zone in C#.

C#✓ Tested
JavaNumbers & dates

Add days to a date

Parse an ISO date and add calendar days using Java LocalDate.

Java✓ Tested
SQL ServerDates & text

Add days to a date

Use DATEADD for date arithmetic.

DATEADD✓ Tested
SQLiteDates & time

Add days to a date

Use a date modifier for calendar arithmetic.

date✓ Tested
SQLSchema design & transactions

Commit multiple related changes together

SQL: The first transaction prepares the fixtures. The second commits both updates as one unit.

SQL✓ Tested
SQL ServerSchema design & transactions

Commit multiple related changes together

SQL Server: The first transaction prepares the fixtures. The second commits both updates as one unit.

SQL Server✓ Tested
PostgresSchema design & transactions

Commit multiple related changes together

Postgres: The first transaction prepares the fixtures. The second commits both updates as one unit.

Postgres✓ Tested
SQLiteSchema design & transactions

Commit multiple related changes together

SQLite: The first transaction prepares the fixtures. The second commits both updates as one unit.

SQLite✓ Tested
Arduino / CTiming & control

Compare elapsed time across timer rollover

Use unsigned subtraction when a millisecond counter wraps.

rollover✓ Tested
PythonFile operations & archives

Copy a file and preserve its metadata

Python: Use copy2 for a file copy that also attempts to preserve timestamps and permission bits.

Python✓ Tested
Arduino / CGetting Started

Count five LED flashes with a for loop

Arduino / C: Repeat an LED action a known number of times and print the current count.

Arduino / C✓ Tested
Linux CommandsFiles & permissions

Create an empty file

Linux Commands: Use touch to create a file when absent; an existing file keeps its contents but gets updated timestamps.

Linux Commands✓ Tested