Re: get date/ datetime from database
Connector/C++ returns datetime values as %Y-%m-%d %H:%M:%S strings so you need something like ...
time_t String2time_t( const string& strDateTime ){
tm t;
strptime( strDateTime.c_str(), "%F %T", &t );
return mktime(&t);
}
time_t jt = String2time_t( (string) res->getString("columnName") );
which returns SQLstring, convert it to std::string before passig it on.
Subject
Views
Written By
Posted
275
March 19, 2022 04:02AM
187
March 22, 2022 02:47AM
Re: get date/ datetime from database
166
March 22, 2022 09:40AM
Sorry, only registered users may post in this forum.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.