Skip Menu |

This queue is for tickets about the Date-Manip CPAN distribution.

Report information
The Basics
Id: 107553
Status: resolved
Priority: 0/
Queue: Date-Manip

People
Owner: Nobody in particular
Requestors: dja [...] domi.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Odd behaviour on specific date/time
Date: Mon, 05 Oct 2015 11:26:58 +0000
To: bug-Date-Manip [...] rt.cpan.org
From: Dominic Arkwright <dja [...] domi.co.uk>
Hi I'm using Date::Manip to go through data from a provider and I'm converting the variable date formats into something standard for further processing. This command illustrates the problem: perl -e 'use Date::Manip; print UnixDate("2013-03-31 02:00:00", "%Y-%m-%d");' This returns an empty string. On the other hand perl -e 'use Date::Manip; print UnixDate("2013-03-30 02:00:00", "%Y-%m-%d");' perl -e 'use Date::Manip; print UnixDate("2013-03-31 01:00:00", "%Y-%m-%d");' perl -e 'use Date::Manip; print UnixDate("2013-03-31 03:00:00", "%Y-%m-%d");' all return what you'd expect. Every combination I've tried of 2013-03-31 02:xx:xx returns empty and every combination that *isn't* 2am-something on 2013-03-31 returns what you'd expect. I can't explain it; I was hoping you could! Cheers
Subject: Re: [rt.cpan.org #107553] AutoReply: Odd behaviour on specific date/time
Date: Mon, 05 Oct 2015 11:30:51 +0000
To: bug-Date-Manip [...] rt.cpan.org
From: Dominic Arkwright <dja [...] domi.co.uk>
I should point out version/OS: Date::Manip 6.5.1 on both Debian 7.8 and OS X 10.11 On Mon, 5 Oct 2015 at 13:27 Bugs in Date-Manip via RT < bug-Date-Manip@rt.cpan.org> wrote: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "Odd behaviour on specific date/time", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #107553]. Your ticket is accessible > on the web at: > > https://rt.cpan.org/Ticket/Display.html?id=107553 > > Please include the string: > > [rt.cpan.org #107553] > > in the subject line of all future correspondence about this issue. To do > so, > you may reply to this message. > > Thank you, > bug-Date-Manip@rt.cpan.org > > ------------------------------------------------------------------------- > Hi > > I'm using Date::Manip to go through data from a provider and I'm converting > the variable date formats into something standard for further processing. > > This command illustrates the problem: > > perl -e 'use Date::Manip; print UnixDate("2013-03-31 02:00:00", > "%Y-%m-%d");' > > This returns an empty string. On the other hand > > perl -e 'use Date::Manip; print UnixDate("2013-03-30 02:00:00", > "%Y-%m-%d");' > perl -e 'use Date::Manip; print UnixDate("2013-03-31 01:00:00", > "%Y-%m-%d");' > perl -e 'use Date::Manip; print UnixDate("2013-03-31 03:00:00", > "%Y-%m-%d");' > > all return what you'd expect. Every combination I've tried of 2013-03-31 > 02:xx:xx returns empty and every combination that *isn't* 2am-something on > 2013-03-31 returns what you'd expect. > > I can't explain it; I was hoping you could! > > Cheers >
There is no Date::Manip 6.5.1, so I'll assume that you meant 6.51. Also, you didn't include the output of: print DateManipVersion(1),"\n"; as requested in the documentation, so I can't be certain of the timezone you are in... however, this is clearly a timezone related issue. You say basically that you can't parse any date of the format: 2013-03-31 02:xx:xx That's correct. Those dates DID NOT EXIST. Daylight saving time kicked in, so there is an hour that never existed, and Date::Manip knows about that. If you need to parse dates like that, you'll need to do it in the timezone of the provider (who apparently did not have a DST transition at the same time, or who were perhaps using GMT).