Does anyone know how to use this function
DWORD DateTime_GetSystemtime(
HWND hwndDP,
LPSYSTEMTIME lpSysTime
);
Thanks! :-)
Printable View
Does anyone know how to use this function
DWORD DateTime_GetSystemtime(
HWND hwndDP,
LPSYSTEMTIME lpSysTime
);
Thanks! :-)
Erm....I believe you need a datetime common control created to use this....here's the msdn page on it:
http://msdn.microsoft.com/library/de...Systemtime.asp
not sure exactly what you're needing to use it for though....
Well what i want to do is get the year, month, day, and put each into a respective combo box, and make the combo box start out with the current date, but to allow the user to change the date to whatever they want, but i basically want it so that when this thing first loads, that it starts off with the current date.
So today is August 2, 2004, one combo box will be in the 8th positiion which would be August, the other would be on 2 and then the last would be 2004. and then the user can search between whatever dates they wished. Im not sure if you understand what I mean, but I just want it to i can get the date and put each part into a combo box and have it start on that position.
Use the GetSystemTime API
DateTime_GetSystemtime probably calls that or at least gets it's info form the same place anyway
http://msdn.microsoft.com/library/de...systemtime.asp
Well how do u do it? I mean how do you code it, I dont understand
I just added a link, see that
I went to the link but it has no code on how to do it. I mean this is what I did, but it didnt work.
Code:char datebuffer[30];
GetSystemTime(datebuffer);
The function takes a LPSYSTEMTIME variable. You have to do something like:
for it to work correctly.Code:SYSTEMTIME sysTime;
GetSystemTime(&sysTime);
>>>
void GetSystemTime(
LPSYSTEMTIME lpSystemTime
);
<<<
From Fordy's link.
>>> but it has no code on how to do it
It shows you the prototype of the function. It says it returns nothing and takes a single parameter of type LPSYSTEMTIME. Of course passing it a char string won't work, it's looking for something else. If you are going to use the API routines, you'll need to learn to read the documentation, otherwise you'll be scratching your head over every call.
The SYSTEMTIME structure is also described in the documentation. There is a link to it on Fordys link.
As an aside, GetSystemTime() retrieves the time in UTC. If you want the current date/time where you are, corrected for time zone and daylight savings, you should use the GetLocalTime() function instead.
Excellent, thanks to all of you, i got my program to work. Thanks a lot.