for debugging?
--
Bill Moseley
[EMAIL PROTECTED]
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]
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\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]
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
::Format::DateManip -le 'print
DateTime::Format::DateManip-parse_datetime(third tuesday in november)'
2005-11-15T00:00:00
--
Bill Moseley
[EMAIL PROTECTED]
,
--
Bill Moseley
[EMAIL PROTECTED]
;
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]
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
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]
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
, 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]
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
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
strings. This seems like a sane
approach? Or do you have a different method?
Thanks,
--
Bill Moseley
[EMAIL PROTECTED]
?
--
Bill Moseley
[EMAIL PROTECTED]
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
related.
--
Bill Moseley
[EMAIL PROTECTED]
:20070424Z
Is this a problem with the validator?
--
Bill Moseley
[EMAIL PROTECTED]
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
, 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
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
-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
herring?
--
Bill Moseley
mose...@hank.org
(
$current_user-time_zone );
A VMethod would be cleaner, but I was lazy.
--
Bill Moseley
mose...@hank.org
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
and people
that earn their livelihood running massive legacy applications got off their
butts and rewrote them. Today. ;)
--
Bill Moseley
mose...@hank.org
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
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
@{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
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
a new language is added.
--
Bill Moseley
mose...@hank.org
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
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
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
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
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
.
Thanks,
--
Bill Moseley
mose...@hank.org
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
.
--
Bill Moseley
mose...@hank.org
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
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
(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
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
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
'print Class::Singleton-VERSION'
1.4
--
Bill Moseley
mose...@hank.org
, 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
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
. 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
: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
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
in time zone: Africa/Cairo
--
Bill Moseley
mose...@hank.org
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
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
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
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
mat::Strptime->new(
pattern => '%x %X',
locale => 'en_us' );
$dt->set_formatter( $format );
nfreeze( $dt );
--
Bill Moseley
mose...@hank.org
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
58 matches
Mail list logo