Re: [Cppcms-users] booster::locale::as ...
Brought to you by:
artyom-beilis
From: mawan s. <ma...@gm...> - 2015-10-08 03:06:01
|
I want to create date time from string, for example input from form date time field. i currently work from srign and covert to integer year, month , date, hour .. etc and use std:tm to reusable date time. Second, I want to converting from string date time from data base (2016-09-09 08:07:07) to date time , and to string date time. Is booster::locale can handle it? or should i use c++ std::tm and std:time_t? Thanks before .. Regards On Wed, Oct 7, 2015 at 6:11 PM, Artyom Beilis <art...@ya...> wrote: > Just to make an order... > > There is an integer POSIX time - time in seconds since Unix Epoch - it is > returned by time(0) and booster::ptime::now() - with higher accuracy - it > is the basic. > > There is a std::tm (http://en.cppreference.com/w/cpp/chrono/c/tm) that > can represent local time or UTC time and coverted to/from using > booster::ptime::local_time/universal_time from integer representation into > values lime tm_year, tm_hour etc. > similarly to localtime_r/gmtime_r and timegm/mktime but in cross platform > manner, > > http://cppcms.com/cppcms_ref/latest/classbooster_1_1ptime.html > > cppdb uses std::tm as date-time representation, alternatively you can also > encode date/time as ISO string the way you wish. > > boost::locale::as::*time* uses time representation is integer/floating > point number and formats it according to given > flags - it can use local time, utc time or whatever timezone you like time > according to any format you specify > it is provided for human interface time formatting - according to your > locale i.e. 5/30/2015, 30/5/2015 or 2015年5月30日 > > Now which time do you need? > > Artyom Beilis > > ------------------------------ > *From:* mawan sugiyanto <ma...@gm...> > *To:* cpp...@li... > *Sent:* Wednesday, October 7, 2015 1:15 PM > *Subject:* [Cppcms-users] booster::locale::as ... > > Dear All > > Can I use booster::locale::as ...... > > to covert pt time to variable? like string or intenger? > Many example use booster::locale::as ... output to the cout or > response().out() ... > there are no example to covert it to needed variable. > > > Thanks > > > Mawan > > > > > > ------------------------------------------------------------------------------ > Full-scale, agent-less Infrastructure Monitoring from a single dashboard > Integrate with 40+ ManageEngine ITSM Solutions for complete visibility > Physical-Virtual-Cloud Infrastructure monitoring from one console > Real user monitoring with APM Insights and performance trend reports > Learn More > http://pubads.g.doubleclick.net/gampad/clk?id=247754911&iu=/4140 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Full-scale, agent-less Infrastructure Monitoring from a single dashboard > Integrate with 40+ ManageEngine ITSM Solutions for complete visibility > Physical-Virtual-Cloud Infrastructure monitoring from one console > Real user monitoring with APM Insights and performance trend reports > Learn More > http://pubads.g.doubleclick.net/gampad/clk?id=247754911&iu=/4140 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |