|
-
May 6th, 2003, 09:14 AM
#1
Why is it always 1 january 1970??
Hey i have a question, i use a "date time picker" in my projekt and i works ok but for some time now it always show "1970-01-01" whenever i start my program, whats that about?? It's always todays date in the resource view and thats what i want it to be.
I remeber i've read somewere that there, supposedly, is something special with that date and c++ but that doesnt make me any wiser in this particular problem.
any suggestions on how to make it alwats show todays date when i run my prog??
thanx
/Eric
-
May 6th, 2003, 09:16 AM
#2
You have to initialize the date/time picker to the current date. If you use it uninitialized, it will show the 'NULL' date 01-01-1970.
-
May 6th, 2003, 09:23 AM
#3
The inbuilt function (_time) that you use always sets the date and time to jan 1 1970. thats why whenever u start the program you automatically get the above date & time .
regards
-
May 6th, 2003, 09:27 AM
#4
yeah i kinda realized that too but i dont really know how.. i cant get the CTime and COleDateTime stuff to work for me
/Eric
-
May 6th, 2003, 09:28 AM
#5
note: my reply was to what gstercken wrote, thanx for your answer jintojohnson
/Eric
-
May 6th, 2003, 09:29 AM
#6
You have probably created a DDX member variable of type CTime for your control. The default initialization created by class Wizard (in you Dialog's ctor) is '=0'. Just replace this by '=CTime::GetCurrentTime()'.
-
May 6th, 2003, 09:37 AM
#7
thanx alot gstercken!! 
/Eric
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|