how do i convert dd/mm/yy to unix epoch time?

how do i convert dd/mm/yy to unix epoch time?

am 08.03.2006 15:40:28 von Pete

Hi,
I'm looking for a way to convert a given date in the format dd/mm/yy to
unix epoch time.
I've searched the news groups and found that nawk and awk can be used
to convert the current time, but I have been unable to find a way to
convert a specified date. Numerous posts say to use perl but I've never
used perl - I'm in the process of reading O'reilly's book on perl but
need to know a way of doing this soon.

Thanks for any help

Pete

Re: how do i convert dd/mm/yy to unix epoch time?

am 08.03.2006 17:05:47 von Paul Lalli

Pete wrote:
> Hi,
> I'm looking for a way to convert a given date in the format dd/mm/yy to
> unix epoch time.
> I've searched the news groups and found that nawk and awk can be used
> to convert the current time, but I have been unable to find a way to
> convert a specified date. Numerous posts say to use perl but I've never
> used perl - I'm in the process of reading O'reilly's book on perl but
> need to know a way of doing this soon.

parse out your date using the split() function to get the individual
date, month, years components:

perldoc -f split

Use the resulting values in the timelocal function to obtain an epoch
time:

perldoc Time::Local

Once you've made an attempt, I'd be happy to help you debug and/or
improve it if it doesn't work correctly. Feel free to post here again
once you've done that.

Paul Lalli