CDateTimeCtrl,CTime
-
:confused: Hi, In my database date is in text format (like 20030704) and i've to display that date in CDatetimeCtrl, after getting year month and date i am assigning that to control as follows CTime tm(yr,mn,dd,0,0,0); CDateTimeCtrl.SetTime( &tm ); It is showing correct in case year is above 1970, and showing currentdate if year is 1970- 'What could be the reason and any suggesstions how to solve it?? With Thanks and Regards --Kamesh
-
:confused: Hi, In my database date is in text format (like 20030704) and i've to display that date in CDatetimeCtrl, after getting year month and date i am assigning that to control as follows CTime tm(yr,mn,dd,0,0,0); CDateTimeCtrl.SetTime( &tm ); It is showing correct in case year is above 1970, and showing currentdate if year is 1970- 'What could be the reason and any suggesstions how to solve it?? With Thanks and Regards --Kamesh
CTime
doesn't support dates before Jan 1st, 1970. This is due to the C runtime library not supporting these dates in thetime_t
type. UseCOleDateTime
instead ofCTime
to get a greater time range. Hope this helps, Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact" -
:confused: Hi, In my database date is in text format (like 20030704) and i've to display that date in CDatetimeCtrl, after getting year month and date i am assigning that to control as follows CTime tm(yr,mn,dd,0,0,0); CDateTimeCtrl.SetTime( &tm ); It is showing correct in case year is above 1970, and showing currentdate if year is 1970- 'What could be the reason and any suggesstions how to solve it?? With Thanks and Regards --Kamesh
-
CTime
doesn't support dates before Jan 1st, 1970. This is due to the C runtime library not supporting these dates in thetime_t
type. UseCOleDateTime
instead ofCTime
to get a greater time range. Hope this helps, Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact" -
Rage wrote: If we keep on posting the same answers at the same time, I'll quit. :eek: Don't do that! I find that that happens a lot - I'm always posting at the same time as other people. I think it's just me :) OT: I think I've got the record for the fastest reply :). I posted a reply to a message last night so quickly that it showed up when the guy who posted the original message got back to the forum page after sending his message :eek: How's that for posting speed? :cool: Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"