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
676
March 19, 2022 04:02AM
437
March 22, 2022 02:47AM
Re: get date/ datetime from database
483
March 22, 2022 09:40AM
Sorry, you can't reply to this topic. It has been closed.
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.