Rick Measham schreef: > On Thu, 4 Aug 2005, Eugene van der Pijll replied: > >That's a bug. DT::truncate() copies the locale and the timezone, but > >should also copy the formatter. > > Not a bug. Strptime is a ::Format module, all it does is takes a string > and returns a DateTime. > > However, once you have your formatter object, it's as simple as calling > $formatter->format_datetime( $dt );
But Rod wasn't calling the formatter object directly, he was using the "new" 'formatter' parameter to DT::new(): my $dt = DateTime->now( time_zone => 'America/Los_Angeles' , formatter => $formatter ); This formatter is now a property of the $dt DateTime object, and should be preserved in all operations on $dt, such as truncate(). Eugene