What does the value returned by st_mtime in the stat structure mean?

vacation vac269k at monu6.cc.monash.edu.au
Fri Dec 21 15:16:34 AEST 1990


I am writing a UNIX system program to retrieve file information
using the stat system call.

In my code I have the following lines:

     struct stat statbuf;

     stat (filename,&statbuf);

     printf ("%ld",statbuf.st_mtime);

This prints out a number like 661742557 for the time the contents
of the file were last modified.
What does this number mean and how would I convert to more
intelligible format (such as day/month/year hour:minute) if
possible ?

Any comments would be much appreciated.
Ralph Blake   Melbourne, Australia
vac269k at monu6.cc.monash.edu.au



More information about the Comp.unix.programmer mailing list