in reply to scalar localtime() to timestamp

You're relying on your users to give you a date in a pretty specific format. They're likely not to oblige.

You can either write the form to give the pieces of the date in separate fields, maybe with selections or js validation, or else generate the timestamp yourself with a call to scalar gmtime. If that format doesn't suit you, consult 'man strftime' and call POSIX::strftime $fmt, gmtime;

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: scalar localtime() to timestamp
by jonnyfolk (Vicar) on Oct 09, 2003 at 05:14 UTC

    This is just a personal script so the input is just for me to use. In fact it's just a first step - the next one is to extract all the scalar localtime() dates from a file and convert them to timestamp, but I can handle that side so I wanted to check that I was on the right lines with this code before I went further.

    Thanks for the info on strftime - I'll read up on that.