mIRC Homepage

$ctime, SYSTEMTIME and FILETIME

Posted By: twigboy

$ctime, SYSTEMTIME and FILETIME - 20/06/06 09:25 AM

hey, im new to the whole time calculation thing (and i hate it very much). this is for the calendar control for DCX

i tried searching the threads before asking, and the only relevant thread i found was somewhat confusing
http://forums.mirc.com/s...=true#Post40423

i understand that SYSTEMTIME needs to be converted to FILETIME, but that is a 64bit number.
im not quite sure how that is calculated into a value such as $ctime, which mIRC scripts can process easily

any help would be appreciated
(please dont send me links to msdn, ive browsed that enough and dont really understand it as it is)
Posted By: Doqnach

Re: $ctime, SYSTEMTIME and FILETIME - 20/06/06 12:50 PM

why not use the 32bits time_t struct? O_o

http://www.cplusplus.com/ref/ctime/ctime.html

you don't need the time units of a file right? just dates?
Posted By: twigboy

Re: $ctime, SYSTEMTIME and FILETIME - 20/06/06 12:58 PM

hmm, well i still have the problem of converting the SYSTEMTIME format into the time_t format

its just the way that the WinApi retreives the selected date from the MonthCal control
Posted By: Doqnach

Re: $ctime, SYSTEMTIME and FILETIME - 21/06/06 09:54 AM

if I read everything right, you can use the SYSTEMTIME struct and the mktime() function to convert it to a time_t struct...

there is an MFC CTime class too... so if you use MFC you can use that aswell

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/systemtime_str.asp

http://msdn.microsoft.com/library/defaul...colcolctime.asp
Posted By: twigboy

Re: $ctime, SYSTEMTIME and FILETIME - 21/06/06 10:14 AM

yeah i've read up on it, but it still doesnt really give me much of a clue on how to do this

mktime requires a "tm" structure, and returns a "tm" struct
conversion between these formats are a pain! =(
Posted By: Doqnach

Re: $ctime, SYSTEMTIME and FILETIME - 26/06/06 06:43 PM

you can use localtime or gmtime to convert from unix timestamp to tm struct
© 2022 mIRC Discussion Forums