DateTime::Format::MySQL and Leap Seconds - format_datetime Returns Invalid Format

2015-11-16 Thread Robert Stone
omponent: sub format_time { my ( $self, $dt ) = @_; return $dt->hms(':'); } I'm hesitant to add additional logic here to handle the 1 second out of a whole bunch of seconds where leap seconds come into play and MySQL expects this value to be an extra long :59 but I'm happy to prop

Re: Ah, leap seconds

2012-07-01 Thread Darren Duncan
Dave Rolsky wrote: http://serverfault.com/questions/403732/anyone-else-experiencing-high-rates-of-linux-server-crashes-today Thank you very much for this timely word of warning, Dave. Barely 20 minutes after you posted your warning, I broadcasted it to the developers at my workplace, and our

Re: Ah, leap seconds

2012-07-01 Thread Ben Tilly
Can we lose leap seconds now? The existence of time zones, DST, etc demonstrates that few outside of niche astronomers care about matching local time with the sun to any precision under about an hour or so. Running the posibility of bugs is not worth it. Ah, but you say that over time

RE: leap seconds in DateTime

2008-10-03 Thread Monty, James T
Zefram wrote: Jim Monty wrote: Please explain this. I've always thought DateTime *does* handle leap seconds correctly. DateTime `knows', falsely, that there will be no more leap seconds after the last one that it knows of. You can see this, for example, by asking what is the UTC time N seconds

Re: leap seconds in DateTime

2008-10-03 Thread Zefram
Monty, James T wrote: Uh-oh, I don't get the same results with DateTime 0.4304 and ActivePerl 5.8.8 on Windows XP: In the changelog: |0.162003-08-06 | |[ IMPROVEMENTS ] | |- The XS code now implements leap second-related calculations. | However, this is only used on platforms where we can

RE: leap seconds in DateTime

2008-10-03 Thread Monty, James T
Zefram wrote: Jim Monty wrote: Uh-oh, I don't get the same results with DateTime 0.4304 and ActivePerl 5.8.8 on Windows XP: In the changelog: |0.162003-08-06 | |[ IMPROVEMENTS ] | |- The XS code now implements leap second-related calculations. | However, this is only used on platforms where

leap seconds in DateTime

2008-10-01 Thread Zefram
Monty, James T wrote: Please explain this. I've always thought DateTime *does* handle leap seconds correctly. DateTime `knows', falsely, that there will be no more leap seconds after the last one that it knows of. You can see this, for example, by asking what is the UTC time N seconds after

Re: leap seconds in DateTime

2008-10-01 Thread Dave Rolsky
in (second then days, or the reverse?). In the case of UTC and leap seconds, most people probably don't care or _need_ to care, so DateTime works just fine. For those folks who need to care, they probably know what to look for, and can use Time::UTC. This is different from date math, where most

Re: leap seconds in DateTime

2008-10-01 Thread Darren Duncan
Dave Rolsky wrote: If I had it to do all over again, I might consider just ignoring leap seconds altogether. It'd certainly make the internals much simpler. Then for people who actually care, there would be a separate module that handled leap seconds (and maybe _not_ time zones). I guess

Leap Seconds and Epochs

2005-11-20 Thread Rick Measham
Why does time() return a multiple of 60? Surely each time there's a leap second time()%60 should increment? Cheers! Rick Measham

Re: Leap Seconds and Epochs

2005-11-20 Thread mathieu longtin
Cause time since the epoch doesn't measure leap seconds. See in the DateTime manual, under the epoch() method description. On 11/20/05, Rick Measham [EMAIL PROTECTED] wrote: Why does time() return a multiple of 60? Surely each time there's a leap second time()%60 should increment? Cheers

Re: Leap Seconds and Epochs

2005-11-20 Thread Rick Measham
mathieu longtin wrote: Cause time since the epoch doesn't measure leap seconds. See in the DateTime manual, under the epoch() method description. I'm aware that it doesn't measure them ... but I'm wondering why? Surely that makes it Capital-W-Wrong. Perl will return the Wrong number

Re: Leap Seconds and Epochs

2005-11-20 Thread Dave Rolsky
On Mon, 21 Nov 2005, Rick Measham wrote: mathieu longtin wrote: Cause time since the epoch doesn't measure leap seconds. See in the DateTime manual, under the epoch() method description. I'm aware that it doesn't measure them ... but I'm wondering why? Surely that makes it Capital-W-Wrong

Leap seconds only in UTC time zone?

2005-11-05 Thread Mike Schilli
From the DateTime documentation, I would have thought that leap seconds apply to all time zones (except floating ones), but the following code use DateTime; for my $time_zone (qw(UTC America/Los_Angeles)) { my $now = DateTime-new( year = 1972, month

Re: Leap seconds only in UTC time zone?

2005-11-05 Thread Mike Schilli
On Sat, 5 Nov 2005, Mike Schilli wrote: From the DateTime documentation, I would have thought that leap seconds apply to all time zones (except floating ones), but the following code use DateTime; for my $time_zone (qw(UTC America/Los_Angeles)) { my $now = DateTime-new

Re: US gov't looking to kill leap seconds

2005-07-31 Thread Dave Rolsky
On Sun, 31 Jul 2005, Eugene van der Pijll wrote: Dave Rolsky schreef: http://www.post-gazette.com/pg/05210/545823.stm Unfortunately it wouldn't make DT.pm any simpler, since we'd still have the existing leap seconds to account for. And we'd have to implement leap hours in UTC... (Though

US gov't looking to kill leap seconds

2005-07-30 Thread Dave Rolsky
http://www.post-gazette.com/pg/05210/545823.stm Unfortunately it wouldn't make DT.pm any simpler, since we'd still have the existing leap seconds to account for. -dave /*=== VegGuide.Orgwww.BookIRead.com Your guide

Re: US gov't looking to kill leap seconds

2005-07-30 Thread Eugene van der Pijll
Dave Rolsky schreef: http://www.post-gazette.com/pg/05210/545823.stm Unfortunately it wouldn't make DT.pm any simpler, since we'd still have the existing leap seconds to account for. And we'd have to implement leap hours in UTC... (Though not for a couple of hundred years, so you might just

Re: Leap seconds / time zone bug in DateTime.pm

2004-09-01 Thread Dave Rolsky
On Fri, 6 Aug 2004, Eugene van der Pijll wrote: I've attached a patch for the test files. I haven't looked into the DateTime.pm code, because both leap second and the time zone handling code are just too scary! I checked this patch in. I'll try to fix this soon. -dave

Leap seconds / time zone bug in DateTime.pm

2004-08-05 Thread Eugene van der Pijll
There's a bug somewhere in the interaction between leap seconds and time zones. In timezones with a positive offset, datetimes after local midnight but before UTC midnight already are affected by the leap second: $dt = DateTime-new( year = 1997, month = 7, day = 1

Re: off-by-one re leap seconds in subtract_datetime

2004-02-10 Thread Dave Rolsky
On Mon, 9 Feb 2004, Andrew Pimlott wrote: Miscalculation of when we're in a leap minute. Applied. -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/

off-by-one re leap seconds in subtract_datetime

2004-02-09 Thread Andrew Pimlott
Miscalculation of when we're in a leap minute. Andrew --- lib/DateTime.pm.orig2004-01-07 17:39:02.0 -0500 +++ lib/DateTime.pm 2004-02-09 22:19:24.0 -0500 @@ -908,7 +908,7 @@ { my ( $utc_rd_days, $utc_rd_secs ) = $smaller-utc_rd_values; -if (

Re: leap seconds in XS

2003-08-14 Thread Dave Rolsky
the generated code to use the binary search method that Flavio's DateTime::LeapSecond generated code uses. Ok, I did some benchmarks and it looks like date math involving leap seconds (basically an DateTime object where the time zone is _not_ floating) has sped up about 10% or so, which is definitely a good

Re: leap seconds in XS

2003-08-14 Thread Flavio S. Glock
Dave Rolsky wrote: Ok, I did some benchmarks and it looks like date math involving leap seconds (basically an DateTime object where the time zone is _not_ floating) has sped up about 10% or so, which is definitely a good thing. How about moving the pure-Perl DT::LeapSecond to DateTime.pm

Re: leap seconds in XS

2003-08-14 Thread Joshua Hoblitt
How about moving the pure-Perl DT::LeapSecond to DateTime.pm/ ? Seems like a good idea. Do you want to do it or should I? I'd like to keep it separated. I believe it maybe useful outside the context of DT. -J --

Re: leap seconds in XS

2003-08-09 Thread Flavio S. Glock
Dave Rolsky wrote: On Wed, 6 Aug 2003, Flavio S. Glock wrote: Dave Rolsky wrote: Ok, I did some benchmarks and it looks like date math involving leap seconds (basically an DateTime object where the time zone is _not_ floating) has sped up about 10% or so, which is definitely

Re: leap seconds in XS

2003-08-07 Thread Joshua Hoblitt
I suspect updates to it will be quite infrequent, though. Other than new leap seconds, why else would it change? I hadn't read ahead in my email. I was concerned about the functionality being folding into the DT namespace and the DT::Leapsecond interface disappearing. That didn't happen so

Re: leap seconds in XS

2003-08-06 Thread Dave Rolsky
infrequent, though. Other than new leap seconds, why else would it change? -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/

Re: leap seconds in XS

2003-08-06 Thread Dave Rolsky
On Wed, 6 Aug 2003, Flavio S. Glock wrote: Dave Rolsky wrote: Ok, I did some benchmarks and it looks like date math involving leap seconds (basically an DateTime object where the time zone is _not_ floating) has sped up about 10% or so, which is definitely a good thing. How about

Re: integrate leap seconds with core XS code?

2003-07-14 Thread Dave Rolsky
. But when you upgraded DT::LeapSecond it would not recompile DateTime. That's bad. Yeah, that would be bad. The main reason I hadn't integrated this earlier was that for some reason, I thought leap seconds were announced with very little warning (1-2 days), but I found out that they're

Re: integrate leap seconds with core XS code?

2003-07-13 Thread fglock
It would be easy to change the Perl code generator into a C code generator. Then you could use DT::LeapSecond at compile time, if they are using XS, or at runtime, if they are using pure Perl. - Flavio S. Glock

Re: integrate leap seconds with core XS code?

2003-07-13 Thread Dave Rolsky
On Sun, 13 Jul 2003 [EMAIL PROTECTED] wrote: It would be easy to change the Perl code generator into a C code generator. Then you could use DT::LeapSecond at compile time, if they are using XS, or at runtime, if they are using pure Perl. But the point is to avoid having to cross the Perl-C

Re: integrate leap seconds with core XS code?

2003-07-13 Thread fglock
The idea is: you call DT::LS from _DateTime_ Makefile.PL, and it generates C source code that compiles with DT XS - it makes a C include file - it is not a DT::LS XS library. Dave Rolsky wrote: On Sun, 13 Jul 2003 [EMAIL PROTECTED] wrote: It would be easy to change the

Re: integrate leap seconds with core XS code?

2003-07-12 Thread David Wheeler
On Saturday, July 12, 2003, at 01:06 AM, Dave Rolsky wrote: I was thinking of doing this because leap seconds, even if they're not abolished, are infrequent, and announced with enough lead time (6 months) that making a new DateTime.pm release for them is not a problem. The obvious benefit

leap seconds

2003-04-12 Thread fglock
May I import Date::Leapsecond into modules/DateTime.pm/lib/DateTime/Leapsecond.pm? I could then make the changes in DateTime to use it. - Flavio S. Glock

Re: leap seconds

2003-04-12 Thread Dave Rolsky
On Sat, 12 Apr 2003 [EMAIL PROTECTED] wrote: May I import Date::Leapsecond into modules/DateTime.pm/lib/DateTime/Leapsecond.pm? I could then make the changes in DateTime to use it. How will it be used? I've been trying to think of a good way to handle leapseconds in DateTime.pm for a while

Re: Leap seconds

2003-01-14 Thread fglock
Rich Bowen wrote: leap seconds seem kinda arbitrary. Is that just a table that you look up in? Basically, yes. Just like leap years, but there is no rule (there is no exact calculations for it). Some (rarely) days will have one 0-60 seconds minute (instead of 0-59). See also: Date::Leapsecond

Leap seconds

2003-01-13 Thread Dave Rolsky
We need to handle them. Flavio claims that using floating point seconds makes this easier. I have an idea on how to handle it without that, but I'd like to hear Flavio's idea. And if anyone else has any good ideas or pointers to known implementations (I know libtai64 handles it, for one),