telltime

The telltime program uses standard library calls to display the date and time equivalent of time_t values. Execute telltime as follows:

    telltime [-h] [-m] time... 
The -h parameter displays help information. The -m indicates that the parameters are the number of miliseconds since midnight. If -m is not specified then the parameters are the number of seconds since the start of the Unix epoch. As well as converting the supplied parameters, the current time is also shown.

Example

sms> telltime 1130687000
Time now interpreted as 1130687043 (0x4364ea43) - GMT:   Sun Oct 30 15:44:03 2005
Time now interpreted as 1130687043 (0x4364ea43) - local: Sun Oct 30 15:44:03 2005
1130687000 interpreted as 1130687000 (0x4364ea18) - GMT:   Sun Oct 30 15:43:20 2005
1130687000 interpreted as 1130687000 (0x4364ea18) - local: Sun Oct 30 15:43:20 2005
sms> 

telltime.c

telltime.c simply calls the gmtime() and localtime() for each command line parameter and displays the result.

Home