Board index » cppbuilder » TDateTime. How can I do...
Romulo
CBuilder Developer |
TDateTime. How can I do...2003-07-10 11:48:37 PM cppbuilder71 I need to store in the field of the InterBase (TimeStamp) the date and the time in the same field. But, when I put the time in this field I lost the date value. How can I store both value. Did I believe that it was easier to manipulate the values, or am I making something bad? My code : //-------------------------------------------------------------------------- - TDateTime TDM::SetHora(TField* pf) { TDateTime dt = pf->AsDateTime; TDateTime hh = dt.CurrentTime(); Word aa, mm, dd, h, m, s, ms; DecodeDate( dt, aa, mm, dd ); DecodeTime( hh, h, m, s, ms); dt = EncodeDate( aa, mm, dd ); dt = EncodeTime( h, m, s, ms ); ShowMessage( dt.DateTimeString() ); return dt; } //-------------------------------------------------------------------------- - |