Equalent of Linux "stat" in AIX

i would like to know the equivalent of

stat -c %Y <file>

command in AIX.

i tried "

istat

" but its not giving the epoch time and also tried with perl

perl -le'printf "%o", 07777 & (stat)[2] for @ARGV' <file>

it not also provding the timing .

if you have any other suggestion to get the time in seconds of the file from the current time , pls help me out ..

Thanks in Advance .

"istat" is displaying the mtime, atime and ctime down to the seconds.

You can easily calculate the epoch time from a given date: POSIX.1 defines it as the seconds passed since Jan 1st, 1970, 0:00:00. The following additional rules apply:

  • leap seconds are not taken into account, each day is exactly 86400 seconds
  • leap years are: all years divisible by 4, save for the years divisible by 100 but not by 400
  • notice that non-synchronous NTP time is NOT POSIX-compatible

Many systems in fact are not POSIX-compatible in this regard, because they use Mills-algorithm-based NTP Stratum-2-servers.

I hope this helps.

bakunin

thanks for the information Bakunin ! !
since both file timing are going to be incorporate the above, i dont think this is going to be OK to use.

but my question is how we can do that in AIX.

perl -e ' $mtime = (stat("$ARGV[0]"))[9]; printf("%d", $mtime); ' filename

try without octal numbers.