DATEZONE(1)
๐ฆ DATEZONE(1) โ user commands, but make it cute ๐ฆ
yes bestie, this is the datezone page ๐ it lives in the User Commands section and it is genuinely one of the most useful little gremlins in the whole dateutils family. let's get into it.
๐ธ NAME ๐ธ
datezone โ convert DATE/TIMEs between timezones. that's the whole job. she's focused, she's efficient, she slays ๐
โจ SYNOPSIS โจ
datezone [OPTION]... [ZONENAME]... [DATE/TIME]...
๐ซถ DESCRIPTION ๐ซถ
okay so the whole vibe is: you hand datezone some DATE/TIMEs and she converts them between timezones. if you don't give her a DATE/TIME at all, she just defaults to now, which is honestly so valid of her โญ
DATE/TIME can also be one of these lil specials:
nowโ interpreted as the current (UTC) time stamptimeโ the time part of the current (UTC) time stamptodayโ the current date (according to UTC)tomo[rrow]โ tomorrow's date (according to UTC)y[ester]dayโ yesterday's date (according to UTC)
heads up on the date-only case: when DATE/TIME is a date (i.e. the time component is omitted) the result will show the timezone offset at the end of that day. ๐
and on the time-only case: when DATE/TIME is a time (i.e. the date component is omitted) the conversion takes place on the date as specified by --base|-b, by default the current date. ๐ฐ๏ธ
here's the recognized OPTIONs:
๐ OPTIONS ๐
-h,--helpโ display this help and exit. your classic "hello?? what do i do" button ๐-V,--versionโ output version information and exit. little flex, honestly โจ-q,--quietโ Suppress message about date/time or zonename parser errors and fix-ups. The default is to print a warning or the fixed up value and return error code 2. (so if you keep it loud, you get the warning or the fixed-up value AND exit code 2 โ she's telling on you ๐)-b,--base=DTโ For underspecified input use DT as a fallback to fill in missing fields. Also used for ambiguous format specifiers to position their range on the absolute time line. Must be a date/time in ISO8601 format. If omitted defaults to the current date/time. ๐ง-i,--input-format=STRING...โ Input format, can be used multiple times. Each date/time will be passed to the input format parsers in the order they are given, if a date/time can be read successfully with a given input format specifier string, that value will be used. (it's giving "try them in order, first one that parses wins" ๐)--from-locale=LOCALEโ Interpret dates on stdin or the command line as coming from the locale LOCALE, this would only affect month and weekday names as input formats have to be specified explicitly. ๐--from-zone=ZONEโ Interpret dates on stdin or the command line as coming from the time zone ZONE. ๐บ๏ธ--nextโ Show next transition from/to DST. โญ๏ธ--prevโ Show previous transition from/to DST. โฎ๏ธ
๐ FORMAT SPECS ๐
Format specs in dateutils are similar to posix' strftime(). similar, not identical, bestie โ do not come for me.
However, due to a broader range of supported calendars dateutils must employ different rules. ๐
๐ Date specs ๐
%aโ The abbreviated weekday name%Aโ The full weekday name%_aโ The weekday name shortened to a single character (MTWRFAS)%bโ The abbreviated month name%Bโ The full month name%_bโ The month name shortened to a single character (FGHJKMNQUVXZ)%cโ The count of the weekday within the month (range 00 to 05)%Cโ The count of the weekday within the year (range 00 to 53)%dโ The day of the month, 2 digits (range 00 to 31)%Dโ The day of the year, 3 digits (range 000 to 366)%Fโ Equivalent to%Y-%m-%d(ymd's canonical format)%gโ ISO week date year without the century (range 00 to 99)%Gโ ISO week date year including the century%jโ Equivalent to%D%mโ The month in the current calendar (range 00 to 12)%Qโ The quarter of the year (range Q1 to Q4)%qโ The number of the quarter (range 01 to 04)%sโ The number of seconds since the Epoch.%uโ The weekday as number (range 01 to 07, Sunday being 07)%Uโ The week count, day of week is Sun (range 00 to 53)%Vโ The ISO week count, day of week is Mon (range 01 to 53)%wโ The weekday as number (range 00 to 06, Sunday being 00)%Wโ The week count, day of week is Mon (range 00 to 53)%yโ The year without a century (range 00 to 99)%Yโ The year including the century%_yโ The year shortened to a single digit%Zโ The zone offset in hours and minutes (HH:MM) with a preceding sign (+for offsets east of UTC,-for offsets west of UTC)%Odโ The day as roman numerals%Omโ The month as roman numerals%Oyโ The two digit year as roman numerals%OYโ The year including the century as roman numerals%rsโ In time systems whose Epoch is different from the unix Epoch, this selects the number of seconds since then.%rYโ In calendars with years that don't coincide with the Gregorian years, this selects the calendar's year.%dthโ The day of the month as an ordinal number, 1st, 2nd, 3rd, etc.%mthโ The month of the year as an ordinal number, 1st, 2nd, 3rd, etc.%dbโ The business day of the month (since last month's ultimo)%dBโ Number of business days until this month's ultimo
๐ธ Time specs ๐ธ
%Hโ The hour of the day using a 24h clock, 2 digits (range 00 to 23)%Iโ The hour of the day using a 12h clock, 2 digits (range 01 to 12)%Mโ The minute (range 00 to 59)%Nโ The nanoseconds (range 000000000 to 999999999)%pโ The stringAMorPM, noon is PM and midnight is AM.%Pโ Like%pbut in lowercase%Sโ The (range 00 to 60, 60 is for leap seconds) โ yeah the doc literally justโฆ trails off there before the range, so i am faithfully passing the mystery on to you ๐%Tโ Equivalent to%H:%M:%S
๐ฆ General specs ๐ฆ
%nโ A newline character%tโ A tab character%%โ A literal%character
๐ Modifiers ๐
%Oโ Modifier to turn decimal numbers into Roman numerals%rโ Modifier to turn units into real units%0โ Modifier to turn on zero prefixes%SPCโ Modifier to turn on space prefixes%-โ Modifier to turn off prefixes altogetherthโ Suffix, read and print ordinal numbersbโ Suffix, treat days as business days
โ ๏ธ By design dates before 1601-01-01 are not supported. like, not "bug", not "oopsie" โ by DESIGN. so don't come crying to her about your 1599 receipts ๐
For conformity here is a list of calendar designators and their corresponding format string:
ymdโ%Y-%m-%dymcwโ%Y-%m-%c-%wywdโ%rY-W%V-%ubizdaโ%Y-%m-%dblilianโ n/aldnโ n/ajulianโ n/ajdnโ n/amatlabโ n/amdnโ n/a
These designators can be used as output format string, moreover, lilian/ldn and julian/jdn can also be used as input format string. โจ
๐ฅ EXAMPLES ๐ฅ
showing off time: look at her go, no cap.
$ datezone 2012-03-04T12:04:11
2012-03-04T12:04:11+00:00
$
$ datezone Europe/Berlin 2012-03-04T12:04:11
2012-03-04T13:04:11+01:00 Europe/Berlin
$
$ datezone 2012-03-04T12:04:11 UTC
2012-03-04T12:04:11+00:00 UTC
$
$ datezone Europe/Berlin Australia/Sydney 2012-01-01T14:04:00 2012-05-14T12:04:00
2012-01-01T15:04:00+01:00 Europe/Berlin
2012-01-02T01:04:00+11:00 Australia/Sydney
2012-05-14T14:04:00+02:00 Europe/Berlin
2012-05-14T22:04:00+10:00 Australia/Sydney
$
two zones, two timestamps, four lines of absolute slay ๐
๐ AUTHOR ๐
Written by Sebastian Freundt <freundt@fresse.org> โ thank you king ๐
๐ REPORTING BUGS ๐
Report bugs to: https://github.com/hroptatyr/dateutils/issues โ go tell her, she wants to know ๐ซถ
โญ SEE ALSO โญ
The full documentation for datezone is maintained as a Texinfo manual. If the info and datezone programs are properly installed at your site, the command
info (dateutils)datezone
should give you access to the complete manual. ๐ (iykyk, info pages are a whole lifestyle)
and that's the whole page bestie! ๐ฆ this was dateutils version 0.4.11, from November 2025 ๐ stream datezone, tell your friends, convert your timezones responsibly, and remember โ the offset is always in the output. periodt. ๐
โจ
๐ฆ where this page comes from
- ubuntu resolute: dateutils 0.4.11-2 ยท BSD-3-Clause
- ubuntu stonking: dateutils 0.4.11-2 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms