> -----Original Message----- > From: Dermot Paikkos [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 15, 2002 11:06 AM > To: [EMAIL PROTECTED] > Subject: convert ctime to a string > > > Hi Gurus, > > SYS stuff: perl 5.005 on TRU64 UNIX or > activeperl 5.6 on Win32. > > I am getting a file listing and want to get the ctime (create > time) for > each file. My understanding is that ctime is stored in > stat[10] but this > is returning a interger such as 91070454. I was hoping it would come > back with a date string that was human readable. > > Does anyone know how to either get the ctime as a string or convert > the interger into a date that is meaning full??
ctime is "inode change time", not "create time". It is updated by things like chown, chmod, link, etc., or by changes to the file size. You probably want mtime. There is no way on UNIX to get "creation time". Once you have it, use localtime() or gmtime() to convert to separate components or to strings. The POSIX module's strftime() function lets you format the string in a variety of ways. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]