mIRC Home    About    Download    Register    News    Help

Topic Options
#151676 - 20/06/06 10:25 AM $ctime, SYSTEMTIME and FILETIME
twigboy Offline
Vogon poet

Registered: 15/01/03
Posts: 98
Loc: Sydney, Australia
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)

Top
#151677 - 20/06/06 01:50 PM Re: $ctime, SYSTEMTIME and FILETIME
Doqnach Offline
Hoopy frood

Registered: 18/01/03
Posts: 1063
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?
_________________________
If it ain't broken, don't fix it!

Top
#151678 - 20/06/06 01:58 PM Re: $ctime, SYSTEMTIME and FILETIME
twigboy Offline
Vogon poet

Registered: 15/01/03
Posts: 98
Loc: Sydney, Australia
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

Top
#151679 - 21/06/06 10:54 AM Re: $ctime, SYSTEMTIME and FILETIME
Doqnach Offline
Hoopy frood

Registered: 18/01/03
Posts: 1063
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
_________________________
If it ain't broken, don't fix it!

Top
#151680 - 21/06/06 11:14 AM Re: $ctime, SYSTEMTIME and FILETIME
twigboy Offline
Vogon poet

Registered: 15/01/03
Posts: 98
Loc: Sydney, Australia
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! =(

Top
#151681 - 26/06/06 07:43 PM Re: $ctime, SYSTEMTIME and FILETIME
Doqnach Offline
Hoopy frood

Registered: 18/01/03
Posts: 1063
you can use localtime or gmtime to convert from unix timestamp to tm struct
_________________________
If it ain't broken, don't fix it!

Top