conversion of date and time to string [modified]
-
hello guys...i did not inted to confuse all of you. I want to show the system time in a messaagebox and im using the following code
SYSTEMTIME st; GetLocalTime(&st);
now as stated earlier, i want to show it in a messagebox thus need to convert it to string, how can I do that??
modified on Tuesday, September 14, 2010 8:14 AM
-
hello guys...i did not inted to confuse all of you. I want to show the system time in a messaagebox and im using the following code
SYSTEMTIME st; GetLocalTime(&st);
now as stated earlier, i want to show it in a messagebox thus need to convert it to string, how can I do that??
modified on Tuesday, September 14, 2010 8:14 AM
How is the date and time represented? If using
COleDateTime
, you can use itsFormat
method. Otherwise usesprintf_s
orswprintf_s
to format the date and time into a string. You can also useCString::Format
instead.«_Superman_»
I love work. It gives me something to do between weekends. -
hello guys...i did not inted to confuse all of you. I want to show the system time in a messaagebox and im using the following code
SYSTEMTIME st; GetLocalTime(&st);
now as stated earlier, i want to show it in a messagebox thus need to convert it to string, how can I do that??
modified on Tuesday, September 14, 2010 8:14 AM
What do you mean by "date and time" exactly ? You have different types of objects that can represent date and time, so what are you using ? Take a look for instance at COLEDateTime[^].
Cédric Moonen Software developer
Charting control [v3.0] OpenGL game tutorial in C++ -
hello guys...i did not inted to confuse all of you. I want to show the system time in a messaagebox and im using the following code
SYSTEMTIME st; GetLocalTime(&st);
now as stated earlier, i want to show it in a messagebox thus need to convert it to string, how can I do that??
modified on Tuesday, September 14, 2010 8:14 AM
If you're using
ATL/MFC COleDateTime
then have a look at Format method. If you're instead usingWin32
then read about strftime function. :)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
[My articles] -
hello guys...i did not inted to confuse all of you. I want to show the system time in a messaagebox and im using the following code
SYSTEMTIME st; GetLocalTime(&st);
now as stated earlier, i want to show it in a messagebox thus need to convert it to string, how can I do that??
modified on Tuesday, September 14, 2010 8:14 AM
if there are many if's in the replies, maybe you should provide more information to start with. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
hello guys...i did not inted to confuse all of you. I want to show the system time in a messaagebox and im using the following code
SYSTEMTIME st; GetLocalTime(&st);
now as stated earlier, i want to show it in a messagebox thus need to convert it to string, how can I do that??
modified on Tuesday, September 14, 2010 8:14 AM
overloaded Name wrote:
...thus need to convert it to string, how can I do that??
In addition to the others, there's also
asctime()
andctime()
."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
hello guys...i did not inted to confuse all of you. I want to show the system time in a messaagebox and im using the following code
SYSTEMTIME st; GetLocalTime(&st);
now as stated earlier, i want to show it in a messagebox thus need to convert it to string, how can I do that??
modified on Tuesday, September 14, 2010 8:14 AM
in mfc use COleDateTime class and after that Format method in win 32 use sprintf function