FIND YOUR NEXT FEW LINES

Results for “date arithmetic”

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

292 snippets foundClear filters
TypeScriptGetting Started

Calculate a simple total

TypeScript: Multiply a unit price by a quantity, then add a delivery fee.

TypeScript✓ Tested
PowerShellGetting Started

Calculate a simple total

PowerShell: Calculate a simple total using PowerShell 7.

PowerShell✓ Tested
C++Getting Started

Calculate a simple total

C++: Multiply a unit price by a quantity, then add a delivery fee.

C++✓ Tested
CGetting Started

Calculate a simple total

C: Multiply a unit price by a quantity, then add a delivery fee.

C✓ Tested
GoGetting Started

Calculate a subtotal

Calculate a subtotal using a complete Go program with explicit sample inputs.

Go✓ Tested
SQLGetting Started

Calculate a value with SELECT

SQL: Evaluate a small arithmetic expression on the database server.

SQL✓ Tested
SQL ServerGetting Started

Calculate a value with SELECT

SQL Server: Evaluate a small arithmetic expression on the database server.

SQL Server✓ Tested
PostgresGetting Started

Calculate a value with SELECT

Postgres: Evaluate a small arithmetic expression on the database server.

Postgres✓ Tested
SQLiteGetting Started

Calculate a value with SELECT

SQLite: Evaluate a small arithmetic expression on the database server.

SQLite✓ Tested
RustGetting Started

Calculate an order subtotal

Calculate an order subtotal in a complete Rust program using the standard library.

Rust✓ Tested
CNumeric parsing & arithmetic

Check positive integer addition before performing it

C: Check the upper boundary before adding two known nonnegative integers.

C✓ Tested
JavaDates & time zones

Check the Gregorian leap-year rule

Java: Use Year.isLeap rather than checking divisibility by four alone.

Java✓ Tested