file creation date including seconds

Hi,

Is anybody can help me to get the file creation date with seconds?

-rw-r--r-- 1 opsc system 422550845 Aug 22 15:41 StatData.20020821

Thanks in advance

Krishna

I don't know of any contemporary Unix filesystem that stores creation date/time at all.

Just modification time...

an extention to LiveinFree's post.

as my perl book says the filessystem keeps the following times:
last asscess time, last modification time, last inode-change time.

you can get this info by useing stat.

man stat for more info.

I do notice that your filename already has a datestamp on it....you could look at getting the datestamp that is used to create the file changed to include the seconds as well...

i.e.

filename=StatData\.`date +%Y%m%d%M%H%S`

It probably is currently set at (assuming it is scripted to set the date stamp on the file at the time of creation).

filename=StatData\.`date +%Y%m%d%`

Sorry, I'm asking about file date&time below file date&time = Aug 22 15:41, here i will find only hh:mm, my question is how to see hh:mm:ss??????

-rw-r--r-- 1 opsc system 422550845 Aug 22 15:41 StatData.200208

I see.... well in terms of creation date - the answer is you can't - it is not held at all. (Hence my suggestion about having the filenames changed to include the seconds).

If you're after the seconds for last modified - or last accessed....you might be able to do it if you can decipher this from the man page for ls (although that might only be for old files??)

i tried from ls command, but could not get the seconds.

thanks
Krishna

Getting the seconds via standard unix commands is very hard. The only reasonable way to display the seconds is to write a program in c or perl that invokes the stat() system call.