Converting for localtime() or gmtime() to time()

S

Stephen

Hey all!

I know that Perl stores the time as the count of the number of seconds
since Jan 1, 1970. And yeh, there is a function that takes those
number of seconds and converts them into the 9 different values
required to get the nice, readable date/time format that we all like
to see. :)

However, I'm porting information from one database into another. The
second database keeps the time values stored as the way Perl stores
the value, namely the number of seconds since Jan 1, 1970. However,
the first database has the date/time stored via a timestamp variable.
I can write a function that converts the time stamp into an array that
holds the seperate pieces of the timestamp (minutes, hours, seconds,
am/pm, day, month, and year), however, is there a function that can
convert this information to the way Perl stores it?

For example, if I have a timestamp such as May 18th, 2004 8:15PM, I'd
like to have it converted to 1084925700. Is there such a function out
there? Or would I have to determine the number of seconds in the year,
month, day, time given?

Thanks,
-Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top