Results for “date arithmetic”
Small, practical examples. Search by task or narrow things down below.
Add an interval to a date
Perform calendar arithmetic with an interval literal.
INTERVAL✓ Tested
Validate a complete floating-point input
C: strtod exposes both the stopping position and range errors; reject nonfinite results when required.
C✓ Tested
Add calendar days with GNU date
Linux Commands: Anchor date arithmetic at a fixed UTC date to avoid local daylight-saving ambiguity.
Linux Commands✓ Tested
Add days to a date
Use DATEADD for date arithmetic.
DATEADD✓ Tested
Add days to a date
Use a date modifier for calendar arithmetic.
date✓ Tested
Calculate an integer beyond the 64-bit range
C#: Use BigInteger for arbitrary-precision integer arithmetic.
C#✓ Tested
Detect integer overflow with checked
C#: A checked arithmetic block throws instead of silently wrapping an integer result.
C#✓ Tested
Increment a stored value in the database
SQL: An in-database arithmetic update avoids a separate application read-modify-write step.
SQL✓ Tested
Increment a stored value in the database
SQL Server: An in-database arithmetic update avoids a separate application read-modify-write step.
SQL Server✓ Tested
Increment a stored value in the database
Postgres: An in-database arithmetic update avoids a separate application read-modify-write step.
Postgres✓ Tested
Increment a stored value in the database
SQLite: An in-database arithmetic update avoids a separate application read-modify-write step.
SQLite✓ Tested
Round a decimal using an explicit midpoint rule
C#: Use decimal literals for decimal arithmetic and choose the midpoint rounding behavior.
C#✓ Tested