News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

DateTimePicker, GetFileTime output formats

Started by Mr Earl, June 07, 2007, 01:30:05 PM

Previous topic - Next topic

Mr Earl

Is there a function to compare "DateTimePicker" output to "GetFileTime" output, or to convert the outputs to the same format?

Darrel

I have no idea what format DateTimePicker is in, but you might try FileTimeToSystemTime or SystemTimeToFileTime.

HTH,

Darrel

sinsi

DateTimePicker.Value is a DateTime
Quote
The DateTime value type represents dates and times with values ranging from 12:00:00 midnight, January 1, 0001 Anno Domini (Common Era) through 11:59:59 P.M., December 31, 9999 A.D. (C.E.)

Time values are measured in 100-nanosecond units called ticks, and a particular date is the number of ticks since 12:00 midnight, January 1, 0001 A.D. (C.E.) in the GregorianCalendar calendar. For example, a ticks value of 31241376000000000L represents the date, Friday, January 01, 0100 12:00:00 midnight. A DateTime value is always expressed in the context of an explicit or default calendar.

so use DateTime.ToFileTime ??? I got a bit lost in all the C++/C#/VB/net stuff, so have a look at
http://msdn2.microsoft.com/en-us/library/system.datetime.tofiletime.aspx

The only trouble I can see is that GetFileTime returns since January 1, 1601 (UTC) and not January 1, 0001.
Light travels faster than sound, that's why some people seem bright until you hear them.

Mr Earl

Thanks, SystemTimeToFileTime should do it.  The output of "DateTimePicker"  are ascii chars from a "GetDlgItemText" on the control, which I guess I'll have to manually insert into a SYSTEMTIME structure, then use SystemTimeToFileTime

farrier

Mr Earl,

Use SendMessage to send a DTM_GETSYSTEMTIME to the DTP and it will return a SYSTEMTIME.

hth,

farrier
It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

donkey

Quote from: Mr Earl on June 07, 2007, 01:30:05 PM
Is there a function to compare "DateTimePicker" output to "GetFileTime" output, or to convert the outputs to the same format?

Hi,

You will have to convert them to the same format, FileTime is the best for that for reasons that will become apparent. The function SystemTimeToFileTime is used to convert from the SystemTime format to FileTime format. Once you have them both in FileTime format you can use CompareFileTime to compare the two times.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable