mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
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
https://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)

Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
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!
Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
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

Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
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!
Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
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! =(

Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
you can use localtime or gmtime to convert from unix timestamp to tm struct


If it ain't broken, don't fix it!

Link Copied to Clipboard