[San-Diego-pm] Converting Time from UTC
chris_radcliff at mac.com
Fri Feb 1 16:49:50 PST 2008
If I'm understanding your situation correctly, you should be able to
join the date and time strings with a space, then pass the combined
string into parse_datetime().
On Feb 1, 2008, at 4:21 PM, Mark Schoonover wrote:
> Thanks Chris. The problem I'm having is creating the $string to
> begin with. I've been banging my head on this all day today reading
> cpan, so it's probably something very obvious I'm now too toasted to
> see... This does look like what I'll need to do.
> On Feb 1, 2008 3:57 PM, Chris Radcliff <chris_radcliff at mac.com> wrote:
> Hi Mark,
> There may be a DateTime formatter module that includes your particular
> format. For example:
> There are many to choose from, so you might want to try a few and see
> which one does the best (and possibly fastest) job. Each one will let
> you go straight from a string to a DateTime object:
> my $parser = DateTime::Format::Natural->new();
> my $dt = $parser->parse_datetime($date_string);
> ...and from there you can use DateTime functions as you described.
> Hope that helps.
> On Feb 1, 2008, at 3:42 PM, Mark Schoonover wrote:
> > Good Afternoon PMs!
> > I'm trying to convert from UTC to various US timezones. The time
> > data is recorded in UTC in a CSV file. What I need to do is convert
> > that time to the correct US timezone, plus keep in my daylight
> > savings time. I've looked at DateTime, and it will do what I need,
> > but I'm missing something basic. My time is not broken out by hms
> > seperately, but instead is recorded 00:00 in one field, and mm/dd/
> > yyyy in another. I've played around with DateTime, which has an
> > is_dst method, but I have no idea how to put the date and time into
> > the correct format, and have it create a DateTime object so I can
> > convert to the correct timezone.
> > Any ideas?
> > TIA
> > --
> > Mark Schoonover, CMDBA
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the San-Diego-pm