Click here to Skip to main content
15,892,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionme again: How can I convert DATE into double correctly ? Pin
Checker200316-Oct-06 4:32
Checker200316-Oct-06 4:32 
AnswerRe: me again: How can I convert DATE into double correctly ? Pin
Cedric Moonen16-Oct-06 4:40
Cedric Moonen16-Oct-06 4:40 
AnswerRe: me again: How can I convert DATE into double correctly ? Pin
David Crow16-Oct-06 4:58
David Crow16-Oct-06 4:58 
GeneralRe: me again: How can I convert DATE into double correctly ? Pin
Checker200316-Oct-06 5:22
Checker200316-Oct-06 5:22 
GeneralRe: me again: How can I convert DATE into double correctly ? Pin
Christian Graus16-Oct-06 5:33
protectorChristian Graus16-Oct-06 5:33 
GeneralRe: me again: How can I convert DATE into double correctly ? Pin
Sceptic Mole16-Oct-06 7:58
Sceptic Mole16-Oct-06 7:58 
QuestionRe: me again: How can I convert DATE into double correctly ? Pin
David Crow16-Oct-06 5:55
David Crow16-Oct-06 5:55 
AnswerRe: me again: How can I convert DATE into double correctly ? Pin
cmk16-Oct-06 20:05
cmk16-Oct-06 20:05 
A DATE is an '8-byte floating-point number'.
Time starts midnight, Jan.01 1900.
It is manipulated via the MFC class COleDateTime.

There are 2 time structures (i know of) that can fit in a DWORD:
1. __time32_t structure (obtained by _time32()).
Time starts midnight, Jan.01, 1970.
Resolution to the nearest second.
2. Packed MS-DOS date/time structures as used by DosDateTimeToFileTime()/FileTimeToDosDateTime().
Time starts midnight, Jan.01, 1980.
Resolution to the nearest 2 seconds.

So, either:
1. Write DATE as a binary object to the registry (suggested).
2. Write conversion routines to convert from DATE to either __time32_t or MS-DOS date/time structures (e.g. DATE -> COleDateTime.GetAsSystemTime() -> SystemTimeToFileTime() -> FileTimeToDosDateTime()).


...cmk

Save the whales - collect the whole set

QuestionSearching for function to use?? Pin
Programm3r16-Oct-06 3:49
Programm3r16-Oct-06 3:49 
AnswerRe: Searching for function to use?? Pin
David Crow16-Oct-06 4:04
David Crow16-Oct-06 4:04 
QuestionRe: Searching for function to use?? Pin
Programm3r16-Oct-06 4:10
Programm3r16-Oct-06 4:10 
AnswerRe: Searching for function to use?? Pin
David Crow16-Oct-06 4:53
David Crow16-Oct-06 4:53 
GeneralRe: Searching for function to use?? Pin
Programm3r16-Oct-06 4:54
Programm3r16-Oct-06 4:54 
GeneralRe: Searching for function to use?? Pin
Hamid_RT17-Oct-06 7:38
Hamid_RT17-Oct-06 7:38 
QuestionRegular expression with VC6? Pin
bosfan16-Oct-06 3:39
bosfan16-Oct-06 3:39 
AnswerRe: Regular expression with VC6? Pin
Garth J Lancaster16-Oct-06 3:57
professionalGarth J Lancaster16-Oct-06 3:57 
GeneralRe: Regular expression with VC6? Pin
bosfan16-Oct-06 21:40
bosfan16-Oct-06 21:40 
GeneralRe: Regular expression with VC6? Pin
Garth J Lancaster16-Oct-06 21:47
professionalGarth J Lancaster16-Oct-06 21:47 
GeneralRe: Regular expression with VC6? Pin
bosfan16-Oct-06 21:56
bosfan16-Oct-06 21:56 
GeneralRe: Regular expression with VC6? Pin
Garth J Lancaster16-Oct-06 21:58
professionalGarth J Lancaster16-Oct-06 21:58 
GeneralRe: Regular expression with VC6? Pin
bosfan16-Oct-06 22:29
bosfan16-Oct-06 22:29 
GeneralRe: Regular expression with VC6? Pin
Garth J Lancaster16-Oct-06 21:56
professionalGarth J Lancaster16-Oct-06 21:56 
GeneralRe: Regular expression with VC6? [modified] Pin
bosfan16-Oct-06 23:42
bosfan16-Oct-06 23:42 
AnswerRe: Regular expression with VC6? Pin
Stephen Hewitt16-Oct-06 13:49
Stephen Hewitt16-Oct-06 13:49 
GeneralRe: Regular expression with VC6? Pin
bosfan17-Oct-06 0:40
bosfan17-Oct-06 0:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.