timestamp arithmetic
Timestamp Calculator
Add or subtract time from any Unix timestamp — quick chips for the common operations, or a custom value and unit. Hours, minutes and seconds shift the instant exactly; days and weeks are calendar-aware in the selected timezone so DST never moves your wall clock.
Day/week operations respect DST in the selected timezone.
Result
Result timestamp (seconds)
—
Result timestamp (milliseconds)
—
UTC
—
Selected timezone
—
ISO 8601
—
Relative to base
—
Timestamp ranges: start and end of day, week, month, year
Need the boundaries for a SQL WHERE clause, an analytics window or a log query? Pick a period, a date and a timezone — the generator returns exact second-precision start and end timestamps, plus their UTC renderings.
Start (seconds)
—
Start (UTC)
—
End (seconds)
—
End (UTC)
—
Timestamp math in code
// JavaScript — add 7 days (exact 24h days)
const next = ts + 7 * 86400;
// Python — calendar-aware, DST-safe
from datetime import timedelta, timezone
from zoneinfo import ZoneInfo
dt = datetime.fromtimestamp(ts, ZoneInfo('America/New_York'))
next_week = (dt + timedelta(days=7)).timestamp()
// PostgreSQL — range for "this month"
SELECT
extract(epoch from date_trunc('month', now()))::bigint AS month_start,
extract(epoch from date_trunc('month', now()) + interval '1 month')::bigint AS next_month_start;The Python example shows why calendar-aware math matters: adding a timedeltato a zoned datetime respects local time across DST changes, while raw+ 604800 seconds does not.
Frequently asked questions
How do I add days to a Unix timestamp?
days × 86400. But if you mean "the same wall-clock time on another calendar day", adding 86,400 seconds can be wrong across a DST change — a day may be 23 or 25 hours long. This calculator does calendar-aware day math in your selected timezone, so adding 7 days across a DST boundary lands on the same local time.How do I get the timestamp for the start or end of a day?
00:00:00.000 in the chosen zone; end is the last second of the day (23:59:59 in most tools, or …59.999999999 at full precision). Always pick the timezone — "midnight" is a different instant in every zone.Why do my SQL queries miss the last day of the range?
BETWEEN start AND end is inclusive, but if your end is next-day midnight, use >= start AND < next_day_start instead. Half-open ranges ([start, end)) compose cleanly and never double-count boundary rows. The range generator gives you the exact second-precision boundaries for both styles.What timestamp units do the calculations use?
Related tools
Unix Timestamp Converter
Convert timestamps and dates with automatic unit detection — seconds, milliseconds, microseconds, nanoseconds.
Timestamp to Date
Turn any Unix timestamp into UTC, local time, ISO 8601, RFC 3339 and relative time.
Date to Timestamp
Pick a date, time and IANA timezone to get the exact Unix timestamp in every precision.
Current Unix Time
Live Unix timestamp in seconds, milliseconds, microseconds and nanoseconds with copy buttons.
Epoch Converter
The classic epoch time converter: bidirectional conversion between epoch values and human-readable dates.
Timezone Converter
See one instant across multiple IANA timezones side by side, with add, reorder and copy-all.