Re: [Cppcms-users] booster::locale::date_time to timestamp conversion issues / basis for booster::l
Brought to you by:
artyom-beilis
|
From: Artyom B. <art...@ya...> - 2015-11-26 14:40:06
|
Is CppCMS compiled with ICU on both machines?Is it same CppCMS version? Also can you print all intermediate calculations as well? (i.e. dtCurrentTime,dtSomeMonthAgo and dtStart)In general second difference should be trivial i.e. mostly calculate difference between internal timestamp.
Artyom
From: Alexander Mack <a....@ev...>
To: cpp...@li...
Sent: Thursday, November 26, 2015 3:30 PM
Subject: [Cppcms-users] booster::locale::date_time to timestamp conversion issues / basis for booster::locale::date_time
Hello,
I'm trying to convert a date_time object into a simple timestamp e.g.:
// init environment...
std::locale::global(booster::locale::generator().generate(""));
cppcms::service srv(argc, argv);
// ....
// get some time some month ago..
booster::locale::date_time dtCurrentTime;
booster::locale::date_time dtSomeMonthAgo = dtCurrentTime -
(booster::locale::period::month());
// get date_time for 1970-01-01 00:00:00
booster::locale::date_time dtStart(0);
// get timestamp
int iDifference = dtStart.difference(dtCurrent,
booster::locale::period::second());
That code works fine on Machine A.. But when I'm running the program on
Machine B I get weird results..
On Machine A the timestamp for Mon, 26 Oct 2015 12:37:12 GMT is
1445863032. (correct)
On Machine B the timestamp for Mon, 26 Oct 2015 12:37:12 GMT is
536870912. (wrong)
The times on the machines are equal too.. timedatectl:
Machine A:
Local time: Do 2015-11-26 14:25:12 CET
Universal time: Do 2015-11-26 13:25:12 UTC
Timezone: Europe/Berlin (CET, +0100)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: no
Last DST change: DST ended at
So 2015-10-25 02:59:59 CEST
So 2015-10-25 02:00:00 CET
Next DST change: DST begins (the clock jumps one hour forward) at
So 2016-03-27 01:59:59 CET
So 2016-03-27 03:00:00 CEST
Machine B:
Local time: Do 2015-11-26 14:25:38 CET
Universal time: Do 2015-11-26 13:25:38 UTC
RTC time: Do 2015-11-26 13:25:38
Timezone: Europe/Berlin (CET, +0100)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: no
Last DST change: DST ended at
So 2015-10-25 02:59:59 CEST
So 2015-10-25 02:00:00 CET
Next DST change: DST begins (the clock jumps one hour forward) at
So 2016-03-27 01:59:59 CET
So 2016-03-27 03:00:00 CEST
Maybe someone had the same issue and knows what the problem is?
I would appreciate any tip :-)
Thank you very much,
Alex
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Cppcms-users mailing list
Cpp...@li...
https://lists.sourceforge.net/lists/listinfo/cppcms-users
|