Solution for Exercise 21-4

ex2104

#include <stdio.h>
#include <time.h>

int main()
{
    time_t tictoc;

    tictoc = 946684800;
    printf("The time is now %s",ctime(&tictoc));
    return(0);
}

Output

The time is now Sat Jan  1 00:00:00 2000

Notes

* This output is affected by your local time zone. If you live within the GMT (or UTC) zone, you see the output above. Otherwise, the output is affected by your locale.