Install problems: Can't call method set_time_zone on an undefined value

2004-08-17 Thread Bill Moseley
for debugging? -- Bill Moseley [EMAIL PROTECTED]

should set_time_zone always return $dt?

2005-09-13 Thread Bill Moseley
set_time_zone returns undef if the new time zone is the same as the old. Is that by design? I got caught doing this: return $self-class_time-set_time_zone( $tz ); in the cases when $tz was not changing. -- Bill Moseley [EMAIL PROTECTED]

Re: DateTime::Format and time zones

2005-11-04 Thread Bill Moseley
the parsers should set a floating time zone. my $dt = DateTime::Format::DateManip-parse_datetime($event_time); $dt-set_time_zone( 'floating' ); By the way, I'm open to suggestion on better ways to parse free-form time entries. -- Bill Moseley [EMAIL PROTECTED]

DT::F::DateManip

2005-11-15 Thread Bill Moseley
= $dt\n; print $dt-strftim CST DateTime = 2005-11-15T09:00:00 Tue, Nov 15 2005 9:00 AM CST CST DateTime = 2005-11-15T09:00:00 Tue, Nov 15 2005 9:00 AM CST -- Bill Moseley [EMAIL PROTECTED]

Re: DT::F::DateManip

2005-11-15 Thread Bill Moseley
On Tue, Nov 15, 2005 at 10:23:56AM -0800, Bill Moseley wrote: Anyone know how to set the timzone in Date::Manip differently every time DateTime::Format::DateManip-parse_datetime is called? Here's one ugly way: Date::Manip::Date_Init(TZ=); local $ENV{TZ} = $new_zone; my $z = Date

Re: DT::F::DateManip

2005-11-15 Thread Bill Moseley
::Format::DateManip -le 'print DateTime::Format::DateManip-parse_datetime(third tuesday in november)' 2005-11-15T00:00:00 -- Bill Moseley [EMAIL PROTECTED]

Daylight Saving

2006-01-20 Thread Bill Moseley
, -- Bill Moseley [EMAIL PROTECTED]

Re: Daylight Saving

2006-01-20 Thread Bill Moseley
; Then reset the timezone based on the offset? That's ugly. DST doesn't have to happen everywhere at the same time, I suppose. -- Bill Moseley [EMAIL PROTECTED]

Re: Daylight Saving

2006-02-09 Thread Bill Moseley
On Fri, Jan 20, 2006 at 07:26:16AM -0800, Bill Moseley wrote: I have a zipcode table that lists the city, state, timezone offset (eg -5) and a flag indicating if the location uses daylight saving time for U.S. zipcodes. I don't have the Olson name in the table. How do I set the timezone

Error messages

2006-08-06 Thread Bill Moseley
in a different direction wondering why _compare is being called in the first place and why the stash is being passed. My guess is because of overloading. -- Bill Moseley [EMAIL PROTECTED]

Re: Error messages

2006-08-07 Thread Bill Moseley
On Mon, Aug 07, 2006 at 04:47:56AM -0500, Dave Rolsky wrote: On Sun, 6 Aug 2006, Bill Moseley wrote: In general, instead of: Carp::croak( Cannot compare a datetime to a regular scalar ) unless ( DateTime::Helpers::can( $dt1, 'utc_rd_values' ) DateTime::Helpers

Format::DateManip and Daylight Saving change

2006-10-03 Thread Bill Moseley
, Dec 3 2006 8:00 AM PST It guessing my timezone is ok, but it's not exactly what outcome I'd like. Is that a problem with that module or the way I'm using it? -- Bill Moseley [EMAIL PROTECTED]

Re: Format::DateManip and Daylight Saving change

2006-10-04 Thread Bill Moseley
On Tue, Oct 03, 2006 at 01:57:29PM -0700, Bill Moseley wrote: $ perl -l dt.pl 'Dec 3, 2006 9am' Sun, Dec 3 2006 8:00 AM PST What time is: Dec 3, 2006 9am PDT ? (noting that it's PST in December) Using Manip is nice because it allows a wide range of input values ('first Tuesday in December

Re: Can't locate object method era_abbreviation

2007-01-06 Thread Bill Moseley
On Sat, Jan 06, 2007 at 11:13:34AM -0600, Dave Rolsky wrote: On Sat, 6 Jan 2007, Bill Moseley wrote: I just grabbed latest from CPAN and get: [EMAIL PROTECTED]:~/build/DateTime-0.35$ prove -b t/03components.t t/03componentsok 52/135Can't locate object method era_abbreviation via

User preferences for I18N

2007-07-07 Thread Bill Moseley
strings. This seems like a sane approach? Or do you have a different method? Thanks, -- Bill Moseley [EMAIL PROTECTED]

Re: DateTime::Locale encoding

2007-08-07 Thread Bill Moseley
? -- Bill Moseley [EMAIL PROTECTED]

Re: DateTime::Locale encoding

2007-08-08 Thread Bill Moseley
On Tue, Aug 07, 2007 at 07:51:35PM +0200, Tobias Kremer wrote: Am 07.08.2007 um 18:40 schrieb Bill Moseley: On Tue, Aug 07, 2007 at 06:30:46PM +0200, Tobias Kremer wrote: Yes, that's exactly why I just don't understand the problem. The rest of my templates, which are all utf-8 encoded

Re: DateTime::Locale encoding

2007-08-08 Thread Bill Moseley
related. -- Bill Moseley [EMAIL PROTECTED]

DateTime::Format::ICal

2008-03-04 Thread Bill Moseley
:20070424Z Is this a problem with the validator? -- Bill Moseley [EMAIL PROTECTED]

iso8601 with timezone

2008-06-07 Thread Bill Moseley
Is there a better approach than this to include the timezone? my $iso_date = $dt-set_time_zone( 'UTC' )-iso8601 . 'Z'; -- Bill Moseley [EMAIL PROTECTED] Sent from my iMutt

Last Second of Day for the given date?

2009-03-12 Thread Bill Moseley
, the smallest interval possible is one day, so if the same date is entered for both start and end then the interval is the entire day. Yes, a bit convoluted. -- Bill Moseley mose...@hank.org Sent from my iMutt

Re: Last Second of Day for the given date?

2009-03-12 Thread Bill Moseley
On Thu, Mar 12, 2009 at 02:28:34PM -0500, Dave Rolsky wrote: On Thu, 12 Mar 2009, Bill Moseley wrote: Is there a canonical approach, or is it something like: $dt-add( days = 1 )-truncate( to = 'day' )-subtract( seconds = 1 ); That should work fine, _but_ if you're not in the floating

DateTime::Format::DateManip

2009-03-31 Thread Bill Moseley
-set_time_zone($dt_tz); In my case I now have 'US/Pacific'. If setting the timezone like this shouldn't it be a floating time initially? -- Bill Moseley mose...@hank.org Sent from my iMutt

Item #1 returned by STORABLE_freeze for DateTime is not a reference

2009-07-13 Thread Bill Moseley
herring? -- Bill Moseley mose...@hank.org

Re: time_zone and DateTime::Format::Strptime

2009-12-15 Thread Bill Moseley
( $current_user-time_zone ); A VMethod would be cleaner, but I was lazy. -- Bill Moseley mose...@hank.org

Re: Potential DateTime DOS Attack

2009-12-15 Thread Bill Moseley
be enough? Or a more active built in restriction on future dates that users of DataTime must manually override... Would a global be too ugly for a short-term fix? $DateTime::MaxFutureYears = 20; # no dates more than 20 years from current year. -- Bill Moseley mose...@hank.org

Re: Potential DateTime DOS Attack

2009-12-15 Thread Bill Moseley
and people that earn their livelihood running massive legacy applications got off their butts and rewrote them. Today. ;) -- Bill Moseley mose...@hank.org

Re: Potential DateTime DOS Attack

2009-12-15 Thread Bill Moseley
in the most idle code. DateTime might be the most central place to put in central validation on year input. The best solution is that Schwern gets a patch in ;) Yes, that would be a good solution, too. ;) -- Bill Moseley mose...@hank.org

modified2010-02-02T24:02:01Z/modified

2010-02-02 Thread Bill Moseley
in throwing an error? The Date: header for the email in question is: Date: Tue, 02 Feb 2010 00:02:01 + -- Bill Moseley mose...@hank.org

Is DateTime::TimeZone-all_names complete?

2010-11-02 Thread Bill Moseley
@{DateTime::TimeZone-all_names}' 401 Seems pretty close to http://en.wikipedia.org/wiki/List_of_tz_database_time_zones Excuse my ignorance of TZ values for India, but are there timezone names corresponding to those cities? -- Bill Moseley mose...@hank.org

DateTime::Locale::load

2010-11-20 Thread Bill Moseley
is if we start supporting more languages in our app is there other system-level language files that need to be updated other than just DateTime? (i.e. system locale packages). Thanks, -- Bill Moseley mose...@hank.org

Re: DateTime::Locale::load

2010-11-20 Thread Bill Moseley
a new language is added. -- Bill Moseley mose...@hank.org

Re: DateTime::Locale::load

2010-11-21 Thread Bill Moseley
On Sat, Nov 20, 2010 at 8:09 PM, Dave Rolsky auta...@urth.org wrote: If there is a locale in DateTime::Locale for the id, then it will provide the same set of datetime localization information as any other locale. Does that answer your question? Yes. Thanks. -- Bill Moseley mose

Adding methods to DateTime.

2011-09-20 Thread Bill Moseley
easy to write the check directly.) * This started out as a Moose question because I saw some code added to our app that was using Moose Roles as an Exporter-replacement -- that is using with to bring in the role but then calling the code as functions not as methods. Thanks, -- Bill Moseley

Re: Adding methods to DateTime.

2011-09-20 Thread Bill Moseley
Thanks for the feedback everyone. On Wed, Sep 21, 2011 at 12:20 AM, Zefram zef...@fysh.org wrote: Bill Moseley wrote: The other approach is a utility module using Exporter[*] -- then do is_in_future( $dt ), but I'm not thrilled by that. This is the most sensible approach. It won't step

The default datetime format for the object’s locale

2012-10-23 Thread Bill Moseley
how we can set the default format used by %c for a given locale. In a web app what we are currently doing is setting DateTime-DefaultLocale() per request. The DateTime objects are inflated from database rows with DBIC. -- Bill Moseley mose...@hank.org

Re: Time::OlsonTZ::Data 0.201210 announcement

2012-11-13 Thread Bill Moseley
2009 installed. Although there doesn't seem like any significant change in DateTime since then, maybe DateTime depends on something that does matter. -- Bill Moseley mose...@hank.org

How to correctly add a duration to not have it result in invalid date?

2013-03-07 Thread Bill Moseley
. Thanks, -- Bill Moseley mose...@hank.org

Re: How to correctly add a duration to not have it result in invalid date?

2013-03-08 Thread Bill Moseley
that with DateTime by using the floating pseudo-timezone.) In my experience the floating times open up other headaches. We store all times with a timezone -- we would rarely have something like 9am your time because of the ambiguity. Thanks very much for the comments. -- Bill Moseley mose...@hank.org

Re: How to correctly add a duration to not have it result in invalid date?

2013-03-08 Thread Bill Moseley
. -- Bill Moseley mose...@hank.org

Re: How to correctly add a duration to not have it result in invalid date?

2013-03-09 Thread Bill Moseley
I don't want to drag discussion on too much longer, and moving way off the original topic, but I do have an implementation question. On Fri, Mar 8, 2013 at 11:48 PM, Jim Monty jim.mo...@yahoo.com wrote: Bill Moseley wrote: UTC is a timezone, too. Yes, poor choice of words. That sentence I

Re: How to correctly add a duration to not have it result in invalid date?

2013-03-10 Thread Bill Moseley
of the United States! You know, yesterday I got curious and set both my Android phone and my wife's iPhone for a 2:30am alarm. I was curious when it would go off. Unfortunately, I told my wife about this and the experiment was quickly called off. -- Bill Moseley mose...@hank.org

DateTime setting invalid zone.

2013-03-12 Thread Bill Moseley
(0x7fc4c2aafc90) My question is should DateTime associate that timezone to $dt if the set_time_zone call actually throws an exception? -- Bill Moseley mose...@hank.org

Re: DateTime setting invalid zone.

2013-03-14 Thread Bill Moseley
On Wed, Mar 13, 2013 at 9:10 AM, Dave Rolsky auta...@urth.org wrote: On Tue, 12 Mar 2013, Bill Moseley wrote: So, I found some old that wrapped a set_time_zone in an eval. my $dt = DateTime-new( year = 2013, month = 3, day = 10, hour = 2, minute = 4, time_zone

delta_data and time zones

2013-09-15 Thread Bill Moseley
days should show there. Same point in time but also the dates are different. Should DateTime set them to the same timezone before comparing? Or is this left to the user to decided this? -- Bill Moseley mose...@hank.org

Invalid version format

2014-01-06 Thread Bill Moseley
'print Class::Singleton-VERSION' 1.4 -- Bill Moseley mose...@hank.org

Re: Invalid version format

2014-01-06 Thread Bill Moseley
, 2014 at 9:03 PM, Bill Moseley mose...@hank.org wrote: This is a long-shot/stabbing-in-the-dark post -- and I'm guessing this might not have anything to do with DateTime. Anyone have any suggestions what might be happening here? I have this code running in a Catalyst app running under mod_perl

Re: Invalid version format

2014-01-08 Thread Bill Moseley
Thanks Dave for looking at this. On Tue, Jan 7, 2014 at 1:53 PM, Dave Rolsky auta...@urth.org wrote: On Mon, 6 Jan 2014, Bill Moseley wrote: I have this code running in a Catalyst app running under mod_perl: I'm inclined to blame mod_perl, since in my experience it tends to do weird

localized date formats

2014-01-16 Thread Bill Moseley
. 16. 오후 5:10 Won't be using the full format, but showing a timezone is needed. Can (or does?) EST get localized? Thanks, -- Bill Moseley mose...@hank.org

Re: localized date formats

2014-01-26 Thread Bill Moseley
:42 ص using format: medium : 26‏/01‏/2014 10:37:42 ص using format: short : 26‏/1‏/2014 10:37 ص On Thu, Jan 16, 2014 at 2:29 PM, Bill Moseley mose...@hank.org wrote: I would like to simplify our localization of dates and, if possible, just use this format for timestamps: $dt-strftime( '%x

Re: localized date formats

2014-01-26 Thread Bill Moseley
at work if anyone has experience with libicu, but it wouldn't be anyone also with XS experience. Any suggestions on what to do in the near term working with current DateTime? Punt with 26 يناير، 2014 EST 10:37:42 ص? Thanks, -- Bill Moseley mose...@hank.org

Hard to keep up with DST changes

2015-04-22 Thread Bill Moseley
in time zone: Africa/Cairo -- Bill Moseley mose...@hank.org

Re: Did April go missing in Asia/Amman?

2016-04-25 Thread Bill Moseley
ks. I'll study this. I didn't think dividing by 60, adding 60 and >>> >subtracting 60 was safe before of leap seconds. >>> >>> POSIX time, what DateTime calls "epoch" time, doesn't count leap seconds. >>> Each multiple of 60 corresponds to the top of a UTC minute. >>> >>> -zefram >>> >> >> > -- Bill Moseley mose...@hank.org

Did April go missing in Asia/Amman?

2016-04-22 Thread Bill Moseley
uot;Asia/Amman" )->subtract( days => 23)->truncate( to => "month" ); print $t' 2016-03-01T00:00:00 Some kind of April fool's issue? Exists elsewhere in same offsets: perl -wle 'use DateTime; my $t = DateTime->now( time_zone => "Asia/Tel_Aviv" )->subtract( days => 22)->truncate( to => "month" ); print $t' 2016-04-01T00:00:00 -- Bill Moseley mose...@hank.org

Re: Did April go missing in Asia/Amman?

2016-04-22 Thread Bill Moseley
running the query for. In other words, I'm trying to find the start and end times for the current month based on a given timezone and then use those in my database query. On Fri, Apr 22, 2016 at 3:51 PM, Zefram <zef...@fysh.org> wrote: > Bill Moseley wrote: > >Why can't I trunca

Re: Did April go missing in Asia/Amman?

2016-04-23 Thread Bill Moseley
On Sat, Apr 23, 2016 at 10:14 AM, Zefram <zef...@fysh.org> wrote: > Bill Moseley wrote: > >hour=> 12, # Assume this exists > > This does not always exist. Africa/Khartoum on 2000-01-15, for example. > In fact, thanks to cases such as Pacific/A

Storable and DateTime::Format::Strptime

2016-10-22 Thread Bill Moseley
mat::Strptime->new( pattern => '%x %X', locale => 'en_us' ); $dt->set_formatter( $format ); nfreeze( $dt ); -- Bill Moseley mose...@hank.org

Re: How to check if a DateTime is invalid (again - but this time without using eval)?

2017-07-05 Thread Bill Moseley
ously linked: >> https://metacpan.org/pod/Try::Tiny#BACKGROUND >> > > Yes, this is exactly why I would recommend always using Try::Tiny over > plain eval. > > Cheers, > > Dave Rolsky > http://blog.urth.org > https://github.com/autarch > > -- Bill Moseley mose...@hank.org