[NCLUG] perl datestring to timestamp conversion ?

Matt Taggart matt at lackof.org
Mon Jan 10 15:06:26 MST 2005


dann frazier writes...

> On Mon, Jan 10, 2005 at 11:24:34AM -0700, Gabriel Somlo wrote:
> > Hi,
> > 
> > I'm trying to write a perl script that receives a bunch of lines
> > containing time stamps formatted like so:
> > 
> > 	YYYY-MM-DD hh:mm:ss [utc]
> 
> If this is the entire purpose of your script, you maybe able to just
> use the date command instead:

You forgot to read the part that said he wanted it to be portable to non-UNIX 
systems.

perl has localtime and gmtime functions. They may not be as cool as the posix 
module you're using, but I bet they'll exist for any version of perl. man 
perlfunc(1).

-- 
Matt Taggart
matt at lackof.org





More information about the NCLUG mailing list