Need to convert DWORD to Date Time
-
I need to convert DWORD to Date time. Can any one suggest me
-
I need to convert DWORD to Date time. Can any one suggest me
:confused: Please detail. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
:confused: Please detail. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain ClarkeI have a DWORD value 524642425 I need to see this value in Date Time Can i know how to use to get the value using COleDateTime.
-
I have a DWORD value 524642425 I need to see this value in Date Time Can i know how to use to get the value using COleDateTime.
OK. But what does it represent (i.e. How did you obtained it? Is it the result of any API call?)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
I have a DWORD value 524642425 I need to see this value in Date Time Can i know how to use to get the value using COleDateTime.
What CPallini wanted to know (I suppose) is how is your date coded into your DWORD ?
Cédric Moonen Software developer
Charting control [v1.3] -
What CPallini wanted to know (I suppose) is how is your date coded into your DWORD ?
Cédric Moonen Software developer
Charting control [v1.3]Yes I using a dll the DWORD is return from that dll and the Datetime is coded in that value.I want to check that date and time in vc++
-
Yes I using a dll the DWORD is return from that dll and the Datetime is coded in that value.I want to check that date and time in vc++
:sigh: Please try to understand what we are asking before replying. How is the date encoded in the DWORD ? In other word, what does a digit represent ? A second, a milisecond, ... ? To which date correspond the 0 value ?
Cédric Moonen Software developer
Charting control [v1.3] -
What CPallini wanted to know (I suppose) is how is your date coded into your DWORD ?
Cédric Moonen Software developer
Charting control [v1.3]You suppose correctly, my friend. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
:sigh: Please try to understand what we are asking before replying. How is the date encoded in the DWORD ? In other word, what does a digit represent ? A second, a milisecond, ... ? To which date correspond the 0 value ?
Cédric Moonen Software developer
Charting control [v1.3]Now, I suppose he doesn't know. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
You suppose correctly, my friend. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain ClarkeIndicates in 100-nanosecond intervals the stop time of this sample. The above mention is the sdk document we have regarding the DWORD
-
Indicates in 100-nanosecond intervals the stop time of this sample. The above mention is the sdk document we have regarding the DWORD
Finally!!!!
yaminisridaran wrote:
The above mention is the sdk document we have regarding the DWORD
I strongly doubt that it is the
SDK
's reference ofDWORD
(i.e. please indicate the function to whichSDK
help actually refers). Your number represents roughly 52 seconds, what conversion do you need? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Indicates in 100-nanosecond intervals the stop time of this sample. The above mention is the sdk document we have regarding the DWORD
Check Various Time Functions available and find the suitable one[^] I think the value you have is the result of "GetTickCount()" API.
-Sarath. "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts, An Article - Understanding Statepattern
-
Check Various Time Functions available and find the suitable one[^] I think the value you have is the result of "GetTickCount()" API.
-Sarath. "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts, An Article - Understanding Statepattern
GetTickCount returns a number of miliseconds, not a number of 100-nanoseconds.
Cédric Moonen Software developer
Charting control [v1.3] -
Check Various Time Functions available and find the suitable one[^] I think the value you have is the result of "GetTickCount()" API.
-Sarath. "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts, An Article - Understanding Statepattern
Actually 100-nanosend intervals are recorded inside
FILETIME
struct, hence functions likeGetSystemTimeAsFileTime
are possible candidates. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
:sigh: Please try to understand what we are asking before replying. How is the date encoded in the DWORD ? In other word, what does a digit represent ? A second, a milisecond, ... ? To which date correspond the 0 value ?
Cédric Moonen Software developer
Charting control [v1.3]Cedric Moonen wrote:
Please try to understand what we are asking before replying.
5! That'd solve almost 99% of all problems in the world, I'd say. :laugh:
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
Actually 100-nanosend intervals are recorded inside
FILETIME
struct, hence functions likeGetSystemTimeAsFileTime
are possible candidates. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
This is fun! Can I have a turn guessing at what function he used to get the value? Pleeeeeezzzz, it's urgent!
led mike
Damn it! Stand in the queue.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
This is fun! Can I have a turn guessing at what function he used to get the value? Pleeeeeezzzz, it's urgent!
led mike
Yes, now it's your turn. Turn ended (do you realize we're talking about 100-nanosecond intervals? It is fu****g urgent!!!!). :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
I need to convert DWORD to Date time. Can any one suggest me
Based on the limited information you've provided, I'd go with something like:
DWORD dw = 524642425;
Date time dt = dw; ;)Now if you want a more helpful, detailed answer, please rethink your question. Ask yourself something like, "What does 524642425 represent?" Is it the number of seconds since the start of time, or the number of milliseconds since Windows was last started, or the number of nanoseconds since the start of the year, etc?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
I need to convert DWORD to Date time. Can any one suggest me
A nanosecond is one billionth of a second. If you are storing Time in a DWORD represented as 100 nanoseconds then you would not be able to store very much time. a DWORD is a32-bit unsigned integer (0 through 4294967295). You are probably recieving a FILETIME structure: http://msdn2.microsoft.com/en-us/library/ms724284(VS.85).aspx[^] If for some reason you are actually using a DWORD then you can get seconds like this and work from there.
DWORD dwTime = 524642425; DWORD dwSeconds = (dwTime/10000000); //52.4642425 seconds
Best Wishes, -David Delaune