digitalmars.D.learn - recls_time_t to d_time?
- Carlos Santander (3/3) May 15 2005 Does anybody know how to make that conversion?
- David L. Davis (66/69) May 15 2005 I'm not exactly sure if recls_time_t is the same as C's time_t format? B...
- Carlos Santander (7/28) May 15 2005 Thanks, David.
- David L. Davis (71/94) May 15 2005 Carlos,
- Carlos Santander (7/27) May 16 2005 Thanks David. That's what I was looking for.
Does anybody know how to make that conversion? -- Carlos Santander Bernal
May 15 2005
In article <d6804u$5g2$1 digitaldaemon.com>, Carlos Santander says...Does anybody know how to make that conversion? -- Carlos Santander BernalI'm not exactly sure if recls_time_t is the same as C's time_t format? But if it is, then this code below from one of my sub-project might do the trick: Hope this helps you out, David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
May 15 2005
David L. Davis escribió:In article <d6804u$5g2$1 digitaldaemon.com>, Carlos Santander says...Thanks, David. recls_time_t on Unix is just a typedef for C's time_t, so it's your help is really appreciated. On Windows, however, it's a struct { uint lowdatetime, highdatetime }, so I don't know how that'd work. But thanks again. -- Carlos Santander BernalDoes anybody know how to make that conversion? -- Carlos Santander BernalI'm not exactly sure if recls_time_t is the same as C's time_t format? But if it is, then this code below from one of my sub-project might do the trick: [snip] Hope this helps you out, David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
May 15 2005
In article <d68nnv$kte$1 digitaldaemon.com>, Carlos Santander says...David L. Davis escribió:Carlos, On Windows, you should take a look in C:\dmd\src\phobos\std\c\windows\windows.d (private import std.c.windows.windows) where you'll find a couple of API functions for moving datetime between the filetime struct to the systemtime struct...from there you could modify the function I wrote (that's from the same sub-project as the last two were) below to move systemtime into D's Date struct where you can then get a d_time result. //Sample of what's in std\c\windows\windows.d // ---------------------------- Hopefully, this answers your question, David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.htmlIn article <d6804u$5g2$1 digitaldaemon.com>, Carlos Santander says...Thanks, David. recls_time_t on Unix is just a typedef for C's time_t, so it's your help is really appreciated. On Windows, however, it's a struct { uint lowdatetime, highdatetime }, so I don't know how that'd work. But thanks again. -- Carlos Santander BernalDoes anybody know how to make that conversion? -- Carlos Santander BernalI'm not exactly sure if recls_time_t is the same as C's time_t format? But if it is, then this code below from one of my sub-project might do the trick: [snip] Hope this helps you out, David L.
May 15 2005
David L. Davis escribió:Carlos, On Windows, you should take a look in C:\dmd\src\phobos\std\c\windows\windows.d (private import std.c.windows.windows) where you'll find a couple of API functions for moving datetime between the filetime struct to the systemtime struct...from there you could modify the function I wrote (that's from the same sub-project as the last two were) below to move systemtime into D's Date struct where you can then get a d_time result. [snip] Hopefully, this answers your question, David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.htmlThanks David. That's what I was looking for. BTW, I think this code (or something similar) should be in Phobos. std.recls is good, and so is std.date (except that there's no std.date.format and there're problems with timezones), so there should be a way to make them work together. -- Carlos Santander Bernal
May 16 2005