Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

current date and time

What is the simpliest call in Visual C++ with Measurement Studio to extract the current date and time? I am trying to have such info as 1315032804 for March 28th, 2004 at 1:15 pm. Thanks in advance for your advice.
0 Kudos
Message 1 of 6
(6,478 Views)
0 Kudos
Message 2 of 6
(6,478 Views)
You might also find localtime useful to convert between the time_t returned by time and a struct tm which you can pass to strftime, along with a format string, to get the time in the format you indicated.

Tony
0 Kudos
Message 3 of 6
(6,479 Views)
I'm sorry to update this topic a few years later, but i have a question about this subject.
I would like to save files in a folder, this folder needs to have the name of the day the files are saved.
 
i have followed the links in the reply's above, but i couldn't find anything i can use in my application.
My application is a windows Forms application created in microsoft visual C++ 2005 express edition.
 
I'm not sure about how to get the current date information.
hope anyone can give me a clear answer
Hans
0 Kudos
Message 4 of 6
(6,121 Views)
update:
 
I've managed to get the right info, but the way I get it is a bit ugly, I think.
I've add an unvisible MonthCalendar and read the selected date (because the selected date is automatically today).

Aint there a more simple way of getting this done?
or is this method correct?
 
thanks in advance
Hans
0 Kudos
Message 5 of 6
(6,116 Views)
Hi,

Aside from the links already mentioned you can check out the MSDN API for the DateTime class. It now seems that all the general way to get a date and time have now been covered.



Adam

National Instruments
Applications Engineer
0 Kudos
Message 6 of 6
(6,108 Views)