Results for “timezone”
Small, practical examples. Search by task or narrow things down below.
Convert an instant to a regional timezone
Java: Use ZonedDateTime with a named zone to apply that zone’s offset rules.
Java✓ Tested
Format a date in an explicit timezone
Format a date in an explicit timezone with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Convert an aware datetime to another offset
Python: Use astimezone for conversion; replacing tzinfo alone does not convert an instant.
Python✓ Tested
Convert a Unix timestamp to aware UTC
Python: Supply timezone.utc so the result does not depend on the machine time zone.
Python✓ Tested
Convert epoch seconds into an instant
Java: Instant represents a UTC timeline point independent of the default timezone.
Java✓ Tested
Format a known UTC timestamp
Linux Commands: Use GNU date -u and an explicit input offset to avoid local timezone dependence.
Linux Commands✓ Tested
Parse a date without a time component
C#: DateOnly avoids attaching an irrelevant time or timezone to a calendar date.
C#✓ Tested
Read date components in UTC
JavaScript: UTC accessors avoid differences caused by the machine’s local timezone.
JavaScript✓ Tested
Read date components in UTC
TypeScript: UTC accessors avoid differences caused by the machine’s local timezone.
TypeScript✓ Tested