Re: Must DateTime load all Locales?

2014-08-11 Thread David E. Wheeler
On Aug 11, 2014, at 10:01 AM, Dave Rolsky auta...@urth.org wrote: It builds up in-memory data structures for all of the locales? Wow. Yeah, seems like those could be encapsulated in the locales themselves or something, no? Or rather than building this all up via repeated calls to

Re: Must DateTime load all Locales?

2014-08-09 Thread David E. Wheeler
On Aug 7, 2014, at 11:23 AM, Dave Rolsky auta...@urth.org wrote: I think the overhead comes in the DateTime::Locale::_register() function, which is called once for each locale returned by DateTime::Locale::Catalog. I would not think any locales would be loaded until they were needed. And

Re: Must DateTime load all Locales?

2014-08-06 Thread David E. Wheeler
On Aug 6, 2014, at 2:21 AM, Kaare Rasmussen ka...@jasonic.dk wrote: Yeah, I saw that, too, but Sqitch requires localization, which Time::Moment does not support. Best, David I guess it's not enough for you, but T:M's strftime does support locales, it seems. It does? The docs all say

Must DateTime load all Locales?

2014-08-05 Thread David E. Wheeler
DateTimers, While profiling Sqitch, I found that the biggest suck on its time (now that I have removed Moose and Mouse in favor of Moo) is DateTime. The reason? It loads all of the locales in its BEGIN block. Run this to see for yourself: perl -d:NYTProf -e 'use DateTime;' nytprofhtml

Re: Must DateTime load all Locales?

2014-08-05 Thread David E. Wheeler
On Aug 5, 2014, at 3:09 PM, Darren Duncan dar...@darrenduncan.net wrote: Coincidentally, see this blog post I saw yesterday: http://blogs.perl.org/users/chansen/2014/08/timemoment-vs-datetime.html Yeah, I saw that, too, but Sqitch requires localization, which Time::Moment does not support.

Re: Must DateTime load all Locales?

2014-08-05 Thread David E. Wheeler
On Aug 5, 2014, at 4:18 PM, Olivier Mengué olivier.men...@gmail.com wrote: Here is below the output (latest releases of DateTime, DateTime::Locale, DateTime::TimeZone on perl 5.20.0). DateTime::Locale::Catalog is the module that contains all the locales names. David, is it that module that

Windows Locales

2012-08-27 Thread David E. Wheeler
DateTimers, I got a curious test failure on Windows: http://ppm4.activestate.com/MSWin32-x86/5.14/1400/D/DW/DWHEELER/App-Sqitch-0.911.d/log-20120824T022242.txt The error was: Invalid locale name or id: English_United States.1252 The code in question that sets the locale is:

Re: Windows Locales

2012-08-27 Thread David E. Wheeler
On Aug 27, 2012, at 2:29 PM, Dave Rolsky wrote: I'm not sure why you think this would work on Linux either. On my system here's what I get: perl -MPOSIX -E 'say POSIX::setlocale(POSIX::LC_TIME())' en_US.UTF-8 Yeah, me too. That locale will not make DateTime::Locale happy either.

Re: Windows Locales

2012-08-27 Thread David E. Wheeler
On Aug 27, 2012, at 3:33 PM, Dave Rolsky wrote: Heh, go figure. I think I wrote that code, but forgot about it. It strips off any trailing character set in the locale code. You were way ahead of yourself, yo. :-) I found Win32::Locale, which seems to do what I need it to. Ah, cool.

Re: Windows Locales

2012-08-27 Thread David E. Wheeler
On Aug 27, 2012, at 4:11 PM, Sean M. Burke wrote: Bernie, are you interested? (if so, what's your PAUSE ID?) David (Wheeler), are you interested? (if so, what's your PAUSE ID?) No, I have no access to Windows at all. Thanks. David

Re: Olson database legal woes

2012-03-04 Thread David E. Wheeler
On Mar 4, 2012, at 4:46 AM, Zefram wrote: I wrote (back in October): Arthur David Olson and Paul Eggert are being sued Having just noticed this thread in my mail archive, I'm reminded that I ought to post an update for datetime@perl.org readers. The suit was recently dismissed,

Re: Adding methods to DateTime.

2011-09-20 Thread David E. Wheeler
On Sep 20, 2011, at 2:17 PM, Michael G Schwern wrote: #1 is fine so long as you have a reasonable expectation that your methods won't collide with somebody else. If you're doing this in local code (ie. not a distributed library) that's fine. I'd add a test to make sure DateTime itself does

Re: [ANNOUNCE] DateTime::Format::Strptime 1.0900

2009-02-23 Thread David E. Wheeler
On Feb 23, 2009, at 2:38 AM, David Cantrell wrote: No, you can't turn it off. I have a script that I run from a cron job every night that automatically subscribes me to rt.cpan RSS feeds for all of my distributions, adding new feeds to my subscriptions list whenever I uplaod something

Re: [ANNOUNCE] DateTime::Format::Strptime 1.0900

2009-02-23 Thread David E . Wheeler
On Feb 23, 2009, at 8:45 AM, David E. Wheeler wrote: Hrm. I wonder if there isn't a way to subscribe to a single feed for tickets you own. Perhaps: http://rt.cpan.org/Search/Results.rdf?Query=%20Owner%20%3D%20'DWHEELER' Hrm. Almost works, but I get this error in NetNewsWire (after I

Re: Anybody got experience with SQL, EXTRACT, and TIMESTAMP WITH TIME ZONE?

2008-08-20 Thread David E. Wheeler
On Aug 20, 2008, at 21:17, Jonathan Leffler wrote: SELECT UNIQUE EXTRACT(HOUR FROM TIMESTAMP '1999-12-31 23:59:59-08:00') AS ts_hour, EXTRACT(DAY FROM TIMESTAMP '1999-12-31 23:59:59-08:00') AS ts_day, EXTRACT(MONTH FROM TIMESTAMP '1999-12-31 23:59:59-08:00') AS ts_month,

Re: ANNOUNCE: DateTime 0.4303, DT::TZ 0.78, DT::Locale 0.41

2008-07-14 Thread David E. Wheeler
On Jul 12, 2008, at 07:47, Dave Rolsky wrote: DateTime.pm 0.4303 2008-07-12 - There is a new leap second coming at the end of 2008. FYI, I got locale failures when I tried to install this version before I installed the latest DateTime::Locale. :-( Best, David

Re: ANNOUNCE: DateTime::Locale 0.40 and DateTime 0.43

2008-05-18 Thread David E. Wheeler
On May 18, 2008, at 11:05, Dave Rolsky wrote: - Added support for formatting the CLDR date pattern language, which is much more powerful than strftime. This, combined with the latest DateTime::Locale, makes the localized output much more correct. I tried to install DateTime first. Looks

Re: Locales, formats, and time zone madness

2008-05-15 Thread David E. Wheeler
On May 14, 2008, at 16:49, Dave Rolsky wrote: So the question is whether it's worth bothering with this. I'm kind of tempted to just punt and simply display either a long TZ name, abbreviation, or offset. I think that's a reasonable place to start. You'd just need to document that this

Re: DateTime-season?

2008-03-25 Thread David E. Wheeler
On Jan 29, 2008, at 03:19, Zefram wrote: David E. Wheeler wrote: return $date lt '03-21' ? 'winter' : $date lt '06-21' ? 'spring' Northern hemisphere chauvinism. It was a very limited need, in Virginia, so good enough. Aside from the hemisphere issue, the code is also

DateTime-season?

2008-01-28 Thread David E . Wheeler
Hey All, Someone on the Bricolage list needed a season method, so I whipped up this ugly one: sub season { my $date = shift-strftime('%m-%d'); return $date lt '03-21' ? 'winter' : $date lt '06-21' ? 'spring' : $date lt '09-21' ? 'summer'