EDATE(1)

NAME
edate - Enhanced date using ISO-8601, ls-style, dos-style, windows-style, or Unix clock

SYNOPSIS
Display current time:
edate [-LGC] [+Z=zonename] [+f char] [+T format]
Convert from one time format to another:
edate [-LG] [+Z=zonename] supported_date
-o [-LGC] [+Z=zonename] [+f char] [+T format]
edate -C unix_clock
-o [-LGC] [+Z=zonename] [+f char] [+T format]
Set system time (must be super-user):
edate [-LG] [+Z=zonename] supported_date -s
edate -C unix_clock -s A supported_date is any one of iso8601_date, ls_style_date, dos_style_date, or windows_style_date as described below. If a unix_clock is given then it must be prefaced by -C and consist of an integer or hexadecimal value.

DESCRIPTION
edate displays, converts, or sets dates using either ISO-8601 dates, ls-style dates, dos-style dates, windows-style dates, or Unix clock values as its input and output. Unless otherwise indicated, all times are assumed to be local and the necessary conversions to GMT will be made. edate will even correctly recognize dates beyond Jan 19 03:14:08 2038 GMT (assuming that the future standard will treat the 32-bits used by Unix's present-day file system as unsigned).

OPTIONS

-L  LOCAL time represented as either an ISO-8601 date, an ls-style date, a dos-style date, or a windows-style date (default).

-G  GMT time represented as either an ISO-8601 date, an ls-style date, a dos-style date, or a windows-style date.

-C  CLOCK time represented using number of seconds since Jan 1 00:00:00 1970 GMT (NOTE: this unsigned 32-bit value can be greater than 0x7fffffff.)

-o  Convert and then output time (this avoids setting the system clock).

-s  Set the system clock (must be super-user).

+Z  Specify timezone to be used in place of current TZ setting. The timezone should be in the form of:
        All OSes:         STDoffset[DST[offset][,rule]]
    Additionally, if your host provides zoneinfo then you can also use names from the appropriate zoneinfo directory:
        SunOS/Solaris:            /usr/share/lib/zoneinfo
        Linux2, Darwin, FreeBSD:  /usr/share/zoneinfo
        OSF1:                     /etc/zoneinfo
    For example:
        edate +Z=EST5EDT +TIZ  (Available on all OSes)
        edate +Z=US/Eastern    (Available on OSes with zoneinfo)

+fchar
    Field separator character, e.g.: edate +f# +Tv

+Toptions
    TIME format, e.g.: edate Jan 1 +T^rD (number of days since Jan 1)
          ^a: Modifier for absolute time since the epoch
          ^d: Modifier for delta time from now (i.e.
               difference)
          ^r: Modifier for relative time from now (i.e.
               age)
          ^y: Modifier for relative time since start of year
          ^A: Modifier for alpha dates instead of numeric
          ^N: Modifier for numeric dates instead of alpha
          ^G: Modifier for GMT dates instead of local
          ^L: Modifier for local dates instead of GMT
          ^M: Modifier for meridian instead of military
               time
           I: Iso8601 style (same as +T^N~YMD.hms~)
           e: els style (default, same as +TM%_DYt)
           l: ls style (same as +TM%_DQ)
           d: dos style (same as +T^N%_M-D-y^M%_h:~mp~)
           w: windows style
               (same as +T"^N%_M/D/y^M%_tP'M'")
           v: verbose style (same as +TWM%_DTZY)
     Y,M,D,W: year(Y), month(M), day(D), weekday(W)
       h,m,s: hour(h), minutes(m), seconds(s)
         t,T: time as h:m(t), h:m:s(T)
           Q: time or year depending on age
           p: 'a' or 'p' depending on meridian
               (meaningful only with ^M modifier)
           P: 'A' or 'P' depending on meridian
               (meaningful only with ^M modifier)
           y: year modulo 100
           Z: zone name

+T format controls
           \: Output following character verbatim
           ~: Toggle spacing off/on
          %%: Output a single % character
          %D: Output directive 'D' using default width
               and default padding
         %_D: Pad left side of output with blanks
               using default width
         %0D: Pad left side of output with zeros
               using default width
         %-D: Suppress all padding and use minimum width
        %0nD: Output a zero padded field 'n' characters
               wide
        %_nD: Output a blank padded field 'n' characters
               wide
         %nD: Output a right justified field 'n'
               characters wide
        %-nD: Output a left justified field 'n'
               characters wide
        %+nD: Output a field 'n' characters wide
               regardless of ~ spacing If a string occurs within an inner set of quotes then the string is output verbatim (except for any directives within the inner quotes prefaced by a %). Thus, the following are equivalent:
        +T"'DATE: '^N%M/D/Y"    # M/D/Y in outer quotes (% optional)
        +T'"DATE: "^NM/%D/Y'    # M/D/Y in outer quotes (% optional)
        +T'"DATE: ^N%M/%D/%Y"'  # M/D/Y in INNER quotes (% REQUIRED)

DATE FORMATS
An ISO-8601 date is defined as:
    YYYYMMDD[.hhmm[ss]]
The date must be all digits (except for the optional period preceding the hour hh). The year YYYY must be not less than 1970 and not more than 2106. The month MM is specified as 01 through 12, and the day DD is specified as 01 through 31. The time, if given, is specified as either 0000 through 2359 or 000000 through 235959. Any unspecified hh, mm, ss parameters will default to 00. An ls-style date is defined as:
    MON DD [YYYY] [hh:mm[:ss]]
MON is the standard three-letter Ascii abbreviation for the month. The day DD is specified as 1 through 31. The year YYYY, if given, must be not less than 1970 and not more than 2106. If the year is not given then the most recent year gone by will be assumed (you can avoid possible ambiguity by specifying both the year and the time, which is how file dates are listed if you use 'els -l' instead of 'ls -l'). The time, if given, is specified as either 00:00 through 23:59 or 00:00:00 through 23:59:59. Any unspecified hh, mm, ss parameters will default to 0. If both the year and the time are specified, it doesn't matter which one is last. Thus, a date such as 'Jan 31 12:34 2001' is equivalent to 'Jan 31 2001 12:34'. Furthermore, weekdays (e.g. Mon, Tue, Wed, etc.) and timezones (e.g. EST, CDT, MST, etc.) are ignored. Thus, a date such as 'Wed Jan 31 12:34:56 EST 2001' is equivalent to 'Jan 31 2001 12:34:56'. A dos-style date and a windows-style date are respectively defined as:
    MM-DD-[YY]YY [hh:mm[:ss][a|p]]
    MM/DD/[YY]YY [hh:mm[:ss] [AM|PM]]
MM, DD, and hh can be either one or two digits in length and the first digit can optionally be zero. The year can either be two digits (YY) or four digits (YYYY). If a two digit year YY is specified, then YY from 70 through 99 will be taken to mean 1900+YY, and YY from 00 through 68 will be taken to mean 2000+YY. Years beyond 2068 must specify all four digits. If any combination of 'a', 'p', 'am' 'P.m', 'A', 'P', 'AM', 'P.M.', etc. follows the time, then the time will be converted to either A.M. or P.M. A Unix clock value is defined as an unsigned 32 bit decimal, octal, or hexadecimal value in the range 0 through 4294967294 or 0 through 0xfffffffe (note that -1 is used to represent certain error conditions). Unix clock values can be listed using 'els -l +T^as'

EXAMPLES
Display the current time in Iso8601 format:
    edate +TI
Display the current time in Japan:
    edate +Z=Japan      (SunOS/Solaris, Linux, OSF1 only)
    edate +Z=Asia/Tokyo (FreeBSD only)
    edate +Z=JST-9      (All OSes)
Convert the date Feb 29, 1996 12:34:56 GMT to a Unix clock value:
    edate -G 19960229.123456 -o -C
Convert the DOS date 2-29-00 1:00p from Japan time to Local time:
    edate +Z=Japan 2-29-00 1:00p -o -L +Td
    edate +Z=JST-9 2-29-00 1:00p -o -L +Td
Convert the date Feb 29, 2096 12:34:56 from Japan time to US/Eastern:
    edate +Z=Japan Feb 29, 2096 12:34:56 -o +Z=US/Eastern
    edate +Z=JST-9 Feb 29, 2096 12:34:56 -o +Z=EST5EDT
Convert the Unix clock value of 0x87654321 to Local time and specify the output format:
    edate -C 0x87654321 +T'%M %D, %Y %h:%m:%s'
Set the system date to April 1, 2000 12:34 Local time:
    edate -s 20000401.1234
Set the system date to April 1, 2000 12:34:56 Local time using ls-style dates:
    edate -s Apr 1 2000 12:34:56
Set the system date to January 1, 2050 12:34:56 GMT:
    edate -sG 20500101.123456

IMPORTANT NOTE
You must use 'edate' instead of 'date' to correctly set and display dates beyond Jan 19, 2038 03:14:08 GMT. The companion program 'els' must also be used to correctly list any files created beyond this date. Please keep in mind that setting your clock beyond 2038 might cause unexpected results and have undesirable consequences. Converting and displaying dates beyond 2038 using the -o option, however, should pose no risk.

ENVIRONMENT

PAGER
    Name of pager program for displaying help text

AUTHOR
Mark Baranowski
Mark Baranowski / Email: requestXXX@els-software.org (remove XXX)

SEE ALSO
chdate(1), els(1)