Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to find the time in seconds since the Epoch (00:00:00 2

Status
Not open for further replies.

crasho2001

Technical User
Jun 13, 2002
51
TR
Hi,

I am trying to convert local time to seconds since the Epoch (00:00:00).

There is a C function ctime to do this job but I can not use it.
Is there any other way to do find time in seconds since Epoch.

Regards
 
This should do it.

[tt]perl -e 'use POSIX;print time."\n"'[/tt]

Note that it won't be adjusted for your time zone.

Annihilannic.
 

perl -e 'print time'

should do the trick.

On some versions of *nix you can use the 'date +%s' command, however it appears solaris 8.0 does not work.

Scotty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top