> yeah, but then we're bordering on a truly ridiculous number of
> constructors, most of which are just syntactic sugar. I'm afraid I'm
> going to go with Joshua's suggestion on this one. It "feels" right
> because the other constructors already take a time_zone parameter, so this
> one should to
On Wed, 26 Mar 2003, Tim Bunce wrote:
> > > now_local()
> > > now_utc()
> > > today_local()
> > > today_utc
> >
> > Why not have the constructors take any timezone as an argument?
> >
> > ->now( 'utc' )
> >
> > or
> >
> > ->now( timezone => 'local' )
> >
> > or even
> >
> > ->now( timezone
> > Why not have the constructors take any timezone as an argument?
> >
> > ->now( 'utc' )
> >
> > or
> >
> > ->now( timezone => 'local' )
> >
> > or even
> >
> > ->now( timezone => 'floating' )
> >
> > If no arguments are specified you get still get UTC.
>
> You could, but I like the simplicity an
On Tue, Mar 25, 2003 at 09:42:30AM -1000, Joshua Hoblitt wrote:
> On Tue, 25 Mar 2003, Tim Bunce wrote:
>
> > On Mon, Mar 24, 2003 at 06:59:17PM -0600, Dave Rolsky wrote:
> > > On Mon, 24 Mar 2003, Joshua Hoblitt wrote:
> > >
> > > > > True. Though it'll be so commonly used I think it deserves a c
On Tue, 25 Mar 2003, Tim Bunce wrote:
> On Mon, Mar 24, 2003 at 06:59:17PM -0600, Dave Rolsky wrote:
> > On Mon, 24 Mar 2003, Joshua Hoblitt wrote:
> >
> > > > True. Though it'll be so commonly used I think it deserves a constructor.
> > >
> > > Ditto. It would also be nice if it defaults to curr
On Mon, Mar 24, 2003 at 06:59:17PM -0600, Dave Rolsky wrote:
> On Mon, 24 Mar 2003, Joshua Hoblitt wrote:
>
> > > True. Though it'll be so commonly used I think it deserves a constructor.
> >
> > Ditto. It would also be nice if it defaults to current TZ instead of a
> > floating time. The same f
On Mon, 24 Mar 2003, Joshua Hoblitt wrote:
> > True. Though it'll be so commonly used I think it deserves a constructor.
>
> Ditto. It would also be nice if it defaults to current TZ instead of a
> floating time. The same for ->now.
Actually, both ->now and ->today default to UTC, because they
On Mon, 24 Mar 2003, Tim Bunce wrote:
> On Sun, Mar 23, 2003 at 08:35:49PM +, Rich wrote:
> > Rick Measham wrote:
> >
> > >>my $today = DateTime->now;
> > >>$today->truncate(to => "day");
> > >
> > > From memory, this would work for you .. I can't test it here:
> > > $today = DateTime->no
Rick Measham wrote:
>>my $today = DateTime->now;
>>$today->truncate(to => "day");
>
> From memory, this would work for you .. I can't test it here:
> $today = DateTime->now->truncate(to => "day");
>
Certainly does and looks a lot nicer, thanks.
--
Rich
[EMAIL PROTECTED]
On Sun, 23 Mar 2003, Rick Measham wrote:
> >my $today = DateTime->now;
> >$today->truncate(to => "day");
>
> From memory, this would work for you .. I can't test it here:
> $today = DateTime->now->truncate(to => "day");
Yep, that works.
Maybe a FAQ? Also, I think a general FAQ on "I just w
my $today = DateTime->now;
$today->truncate(to => "day");
From memory, this would work for you .. I can't test it here:
$today = DateTime->now->truncate(to => "day");
--
There are 10 kinds of people:
those that understand bin
my $today = DateTime->today;
Like now(), but would set the year, month and day components only.
Useful for date rather than datetime calculations, and nicer than:
my $today = DateTime->now;
$today->truncate(to => "day");
Many thanks,
--
Rich
[EMAIL PROTECTED]
12 matches
Mail list logo