The program below calls getdate() for each of its command-line arguments, and for each call displays the values in the fields of the returned tm structure.The following shell session demonstrates the operation of the program: $ TFILE=$PWD/tfile $ echo '%A' $TFILE # Time (HH: MM: SS) $ date $ export DATEMSK=$TFILE $ ./Tuesday '2009-12-28' '' Sun Sep 7 CEST 2008 Call 1 ("Tuesday") succeeded: tm_sec = 36 tm_min = 3 tm_hour = 6 tm_mday = 9 tm_mon = 8 tm_year = 108 tm_wday = 2 tm_yday = 252 tm_isdst = 1 Call 2 ("2009-12-28") succeeded: tm_sec = 36 tm_min = 3 tm_hour = 6 tm_mday = 28 tm_mon = 11 tm_year = 109 tm_wday = 1 tm_yday = 361 tm_isdst = 0 Call 3 ("") succeeded: tm_sec = 33 tm_min = 22 tm_hour = 12 tm_mday = 7 tm_mon = 8 tm_year = 108 tm_wday = 0 tm_yday = 250 tm_isdst = 1 Program source #define _GNU_SOURCE #include This page is part of release 5.02 of the Linux man-pages project.The first line in the file that matches the given input string is used for the conversion. Superfluous whitespace, either in the pattern or in the string to be converted, is ignored.
For month view, it will always be sometime between the first and last day of the month.
is not the timezone that getdate() expects, an invalid input specification error shall result.
The getdate() function calculates an expected timezone based on information supplied to the function (such as the hour, day, and month).
This tm structure is allocated in static storage, and consequently it will be overwritten by further calls to getdate().
In contrast to strptime(3), (which has a format argument), getdate() uses the formats found in the file whose full pathname is given in the environment variable DATEMSK.