Date Time Picker
-
hi I used the datetimepicker control and I added a member variable for this control, but when i use UpdateData(); the problem occured with any date befor 1969-12-31. is it a bug in vc6? can I use this control for date before 1969-12-31 and how? Best Regards :)
-
hi I used the datetimepicker control and I added a member variable for this control, but when i use UpdateData(); the problem occured with any date befor 1969-12-31. is it a bug in vc6? can I use this control for date before 1969-12-31 and how? Best Regards :)
-
I use this control without any problems. Even the year 1817 is reachable. Your accompanying code must be teh problem. Geert.
-
thanx allways i got the following message: (Debug Assertion failed! program : file.exe timecor.cpp line:40) this file (timecore.cpp)is done with vc6 Best Regards :)
-
Hi, Your problem is that the MFC CTime class actually uses the mktime() call internally. If you look at the definition of mktime() you'll see that it uses a time_t, which is a floating point value representing the number of seconds since, you guessed it, Jan 1 1970. The problem here is the fact that you're mapping your control to a CTime value. Open the ClassWizard and delete the mapped variable. Add it again, but make sure you select COleDateTime from the Variable Type combo. This should give you a much larger range of values. Hope this helps. ------------------------ Derek Waters derek@lj-oz.com
-
Hi, Your problem is that the MFC CTime class actually uses the mktime() call internally. If you look at the definition of mktime() you'll see that it uses a time_t, which is a floating point value representing the number of seconds since, you guessed it, Jan 1 1970. The problem here is the fact that you're mapping your control to a CTime value. Open the ClassWizard and delete the mapped variable. Add it again, but make sure you select COleDateTime from the Variable Type combo. This should give you a much larger range of values. Hope this helps. ------------------------ Derek Waters derek@lj-oz.com
-
Well, assuming that you're using some COM-based technology to access your Access DB (and I would imagine it'd be pretty tough otherwise!) then COleDateTime can easily be converted to a VARIANT of VT_DATE type using COleVariant. This will be exactly the format that Access's automation interface will be expecting. ------------------------ Derek Waters derek@lj-oz.com