Unable to display the date-time in seconds on AIX

Hi,

In unix the command "date +%s" displays the date-time in seconds since �00:00:00 1970-01-01 UTC� (a GNU extension)
when executed on unix:
-sh-2.05b$ date +%s
1152092690

I tried with all the format control output but unable to display the date-time in seconds i,e as in unix format. Can anybody tell me how to display date-time in seconds on AIX or give me the equivalent command as in unix.

Thanks,
Haroon

Try man date. I think you want %S instead of %s.

Hi,

I have tried with all options using man date, but i am not able to display the time on the screen in desired format.
I require date to be displayed in the given format below:

1145470369 - i,e Specifies the time (in seconds) since the epoch (00:00:00 GMT, January 1, 1970).

Thanks,
Haroon

date +%s works fine for me on my AIX 5.3 machine. What is the output when you give this command?

Hi,

When i tried "date +%s" on my AIX 5.1 , it displays %s .

Thanks,
Haroon

Hi,

The command date +%s is not available for AIX 5.1, but available in AIX 5.3. CAn any one plese tell me some combination of commands that will do the job of date +%s on AIX 5.1.

Its an urgent issue please help me.

Thanks,
Haroon

Would perl do?

 #!/usr/bin/perl
$mytime=time;
print "$mytime\n";