How to get time & date? (in VC6)
How to get time and date from your computer in VC++ 6.0?
I don''t want to use timeGetTime() because it doesn''t return the time like: "5:30:21am 15th Nov 2000"
Tnx in advance!
December 16, 2000 01:14 PM
I doubt anything returns the time in that sort of format, you are gonna have to produce the formatting yourself.
(Although I think MFC CTime can do this)
(Although I think MFC CTime can do this)
I wanted to do some time work, so I loked around....
the c++ standard time funcs are slow(1 sec intervals) and i dont care for them. I havnt used the w32 funcs...they are probably slow. I reccomend asm.
Be careful tho...you might end up with some odd times on the computer; I did. :-)
interrupt 1a is the time call, I`ve never had occasion to want the date one. Somewhere there should be a list of the interrupts and the registers they use...
You have to format it yourself, of course...
Actually, once you find the functions/interrupts you need, it should be pretty easy.
You just whip up a cDT class and work from there...
DTs:-p
Anyway, good luck.
~V''lion
I came, I saw, I got programmers block.
~V''''lion
the c++ standard time funcs are slow(1 sec intervals) and i dont care for them. I havnt used the w32 funcs...they are probably slow. I reccomend asm.
Be careful tho...you might end up with some odd times on the computer; I did. :-)
interrupt 1a is the time call, I`ve never had occasion to want the date one. Somewhere there should be a list of the interrupts and the registers they use...
You have to format it yourself, of course...
Actually, once you find the functions/interrupts you need, it should be pretty easy.
You just whip up a cDT class and work from there...
DTs:-p
Anyway, good luck.
~V''lion
I came, I saw, I got programmers block.
~V''''lion
~V'lionBugle4d
December 17, 2000 11:40 AM
If you only care about Windows then GetTimeFormat and GetDateFormat will format times and dates in just about any way you want.
-Mike
-Mike
Tnx Vlion, but I don''t like writing asm..it looks ugly .
But Mike, those functions did the trick, tnx!
But Mike, those functions did the trick, tnx!
Have you looked into "time_t"???
Look for this function in MSDN and you should find everything you need..
...
time_t time( time_t *timer );
...
Hope this helps...
ZaneX
Look for this function in MSDN and you should find everything you need..
...
time_t time( time_t *timer );
...
Hope this helps...
ZaneX
time.h contains about all the time functions you need, including millisecs etc.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement