Subject: | Printf '%o' and CEST: bug or misunderstanding? |
Date: | Wed, 23 Apr 2014 22:13:39 +0200 |
To: | bug-Date-Manip [...] rt.cpan.org |
From: | Emanuele Tomasi <et [...] libersoft.it> |
Date::Manip: v6.43
Perl: v5.18.1
This script:
---
use Date::Manip;
$date_str = '2014-03-31 22:00:00 GMT';
$date = new Date::Manip::Date;
$date->config("tz","CEST");
$date->parse($date_str);
$tm_localtime = $date->printf('%o');
$tm_gmt = $date->printf('%s');
$time_diff_hours = ($tm_localtime - $tm_gmt) / 3600;
print $time_diff_hours . ' hours';
---
Returns "1 hours". But, the difference between CEST and GMT is 2 hours.
What it's wrong?
Note: I'm in Italy and today (2014-04-23) we are GMT+2 (CEST).
Best regards,
Emanuele
--
Emanuele Tomasi <et@libersoft.it>
Libersoft Srl - Linux e software libero
Via Mario Giuntini, 25 - int. 34 - 56021 Navacchio - Cascina (PI)
tel: +39 050 754737
fax: +39 050 754738