Results for “Dates & precise numbers”
Small, practical examples. Search by task or narrow things down below.
Convert between integer bases
TypeScript: Supply a radix when parsing a nondecimal integer string.
TypeScript✓ Tested
Convert epoch seconds into an instant
Java: Instant represents a UTC timeline point independent of the default timezone.
Java✓ Tested
Convert Unix seconds into an aware UTC timestamp
PowerShell: DateTimeOffset.FromUnixTimeSeconds creates a value with an explicit UTC offset.
PowerShell✓ Tested
Convert Unix seconds to UTC
Convert Unix seconds to UTC using a complete Go program with explicit sample inputs.
Go✓ Tested
Copy a file with explicit permissions
Linux Commands: Use install to create parent directories and set the destination mode in one operation.
Linux Commands✓ Tested
Detect integer addition overflow
Java: Math.addExact throws rather than silently wrapping on overflow.
Java✓ Tested
Detect NaN without converting the input
JavaScript: Number.isNaN tests the special numeric value instead of applying string-to-number conversion.
JavaScript✓ Tested
Detect NaN without converting the input
TypeScript: Number.isNaN tests the special numeric value instead of applying string-to-number conversion.
TypeScript✓ Tested
Determine whether a year is a leap year
Python: Use calendar.isleap rather than a simplified divisibility-by-four check.
Python✓ Tested
Display a number with a fixed decimal width
JavaScript: toFixed returns a formatted string rather than a numeric value.
JavaScript✓ Tested
Display a number with a fixed decimal width
TypeScript: toFixed returns a formatted string rather than a numeric value.
TypeScript✓ Tested
Display an instant at a fixed offset
Display an instant at a fixed offset using a complete Go program with explicit sample inputs.
Go✓ Tested