Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^5: Month '-1' out of range 0..11

by kennethk (Abbot)
on Mar 18, 2014 at 16:26 UTC ( #1078803=note: print w/ replies, xml ) Need Help??

in reply to Re^4: Month '-1' out of range 0..11
in thread Month '-1' out of range 0..11

#!/usr/bin/perl -w use strict; use Time::Local; my $finaltime = UTCtoLocal(); print "$finaltime \n"; sub UTCtoLocal { my @ActTime = map {/"(.*?)"/} grep {/MessageDateTime/} (<DATA>); my $iso_time = join("", @ActTime); my $expected_epoch = 1 * 60 * 60 + 1 * 60 + 1; my ($date, $time) = split /T/ => $iso_time; my ($year, $mon, $mday) = split /-/ => $date; $year -= 1900; $mon -= 1; my ($hour, $min, $sec) = split /:/ => $time; my $nsec = chop($sec); my $mtime = timegm($sec, $min, $hour, $mday, $mon, $year); return ($mtime); } __DATA__ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ScheduleMessage SYSTEM "../schedulev2r3/dtd/schedule-xml.dtd +"> <ScheduleMessage DtdVersion="2" DtdRelease="3"> <MessageIdentification v="8787897987897897" /> <MessageVersion v="097" /> <MessageType v="A01" /> <ProcessType v="A02" /> <ScheduleClassificationType v="A01" /> <SenderIdentification v="9090900" codingScheme="A01" /> <SenderRole v="A01" /> <ReceiverIdentification v="453543453453" codingScheme="A01" /> <ReceiverRole v="A04" /> <MessageDateTime v="2014-03-18T15:41:14Z" /> <ScheduleTimeInterval v="2014-03-13T23:00Z/2014-03-14T23:00Z" /> <ScheduleTimeSeries> <SendersTimeSeriesIdentification v="65765675765" /> <SendersTimeSeriesVersion v="001" /> <BusinessType v="A06" /> <Product v="8716867000016" /> <ObjectAggregation v="A01" /> <InArea v="10YFRkjkjkl" codingScheme="A01" /> <OutArea v="10YCHiuiuoiu" codingScheme="A01" /> <InParty v="jkkljkljlkj" codingScheme="A01" /> <OutParty v="uiouiouoiuo" codingScheme="A01" /> <MeasurementUnit v="MAW" /> <Period> <TimeInterval v="2014-03-13T23:00Z/2014-03-14T23:00Z" /> <Resolution v="PT15M" />
outputs 1395157274 as I would expect. You have scrubbed the issue out of your code. Unless you post material that displays the issue you are referencing, I cannot help.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Comment on Re^5: Month '-1' out of range 0..11
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1078803]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2015-11-28 21:11 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (745 votes), past polls