Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtracting 2 dates which are strings

Status
Not open for further replies.

Themuppeteer

Programmer
Apr 4, 2001
449
BE
Hi,
I have a recordset containing 2 fields
i.g. '11 apr 2001 16:38:46:457 ' and
'11 apr 2001 16:39:46:487'

and I want to know how many time there is between them.
I know I can write a complete function to do this (which would be a lot of work), but before I start doing that, I would like to know if there isn't some sort of build in function that can convert these date-time fields to Idono, an integer or somthing ,so i can subtract them easily and save me a lot of time/work.

Thanks,
The Muppeteer

 
Hi,
To use these functions in Win32 API, you will have to convert the string to the "systemtime" or "filetime" format and then compare them. Look at these links for more information...

Honestly,
you should look up code that someone else has already written and do that or write your own. Here is one to start you on your way: Systemtime and filetime can be very confusing and lots of API coding.
I hope this helps!
Brett Please visit my websites!
 
DateDiff("interval", Start, End)

interval ~ ["m" (Month) | "d" (Day) | "h" (Hour) | "n" (Minute) | "s" (Second)]

Start and end are valid dates.
MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top