@rpaisdeoliveira: "Hi!
I'm using DateTim888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TimeZone to get my current time. Shouldn't daylight
saving time be handled by the DateTime module?
In $date I'm obtaining the time with less an hour than it should so I
believe DST is not being considered. How can I obtain the current time
regardless it's in DST mode or not?
Here's my script:
 use 5.14.2;
 use warnings;
 use DateTim888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TimeZone;
 my $tz = DateTim888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TimeZone->new( name => 'Europe/Lisbon' );
 my $date = DateTime->now();
 print $date;
Best regards."
    @rvtolusenet: "<quote>
If your box already is in that timezone, you can use localtime().
perl -Mstrict -we'
   my @dt = reverse +(localtime)[0..5];
   $dt[0] += 1900;  # year
   $dt[1] += 1;  # month
   printf qq{%s-%02d-%02d %02d:%02d:%02d\n}, @dt;
'
2013-04-18 09:09:22
Ruud"
    @uri: "<quote>
i would think you would know about POSIX888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4strftime. much cleaner and 
more flexible than doing it all by hand. it is in core and the standard 
way to print timestamps in almost any format.
uri"
    @rvtolusenet: "<quote>
There is nothing wrong with using localtime like in my example.
Coming from DateTim888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TimeZone, it can be seen as the other end of the 
scale, but it is no rocket science, and `perldoc -f localtime` tells you 
all you need.
Of course POSIX888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4strftime is fine as well. I use it often like this:
perl -Mstrict -MPOSIX=strftime -wle '
   print strftime q{%F %T %z}, localtime;
'
2013-04-18 20:36:16 +0200
With DateTime, you can for example do:
perl -Mstrict -MDateTime -wle '
   print DateTime
     -> now(time_zone => "Europe/Amsterdam")
     -> strftime(q{%F %T %z});
'
2013-04-19 08:23:30 +0200
Also check out Tim888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Local888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4timelocal.
Ruud"
{'source': 'USENET', 'other_information': '{"reply_count": 3, "forum_name": "perl.beginners.20141007.mbox"}', 'file': 'data/output/usenet-perl.beginners.parquet'}