mysql - C++ store and retrieve UTC time with DST info to/from database -


i´m using c++ under linux , confess after reading many posts on theme i´m litte confused around time_t, struct tm, time, ctime , strftime.

what need current system date/time, convert utc , store in database. later on need retrieve date/time , print on screen in human readable format.

i´m using oracle (timestamp), mysql (datetime) , sqlite3 (has no datetime field, stored either on int or varchar()).

the important need store date/time current time zone considering dst time, when result can recover original time zone of dst correct information display.

something like:

// current time  std::time_t = std::time(0);   // convert oracle ??? ? oracletime = ?;  // convert mysql ??? ? mysqltime = ?;  // store on sqlite3 int sqlite3time = now;  // print time std::cout << << std::endl; 

what correct conversion steps here ?

thanks helping.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -