/* * now.c * Simply prints the seconds since unix 'epoch' as an integer on stdout. * epoch in Unix/Posix is Jan 1 1970 * Use: * In scripts as a simple to convert time marker, e.g. for calculations * As input to ftime (The utility built on strftime). * Author: David Horton * * (Have to do somechanges when time_t becomes a 64bit int, or when * we get closer to 2^32 secs since epoch */ #include #include int main() { time_t now = 0; long now_l; now = time(NULL); now_l = (long) now; printf("%d\n", now_l); return (0); }