www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - recls_time_t to d_time?

reply Carlos Santander <csantander619 gmail.com> writes:
Does anybody know how to make that conversion?

-- 
Carlos Santander Bernal
May 15 2005
parent reply David L. Davis <SpottedTiger yahoo.com> writes:
In article <d6804u$5g2$1 digitaldaemon.com>, Carlos Santander says...
Does anybody know how to make that conversion?

-- 
Carlos Santander Bernal
I'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
parent reply Carlos Santander <csantander619 gmail.com> writes:
David L. Davis escribió:
 In article <d6804u$5g2$1 digitaldaemon.com>, Carlos Santander says...
 
Does anybody know how to make that conversion?

-- 
Carlos Santander Bernal
I'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
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 Bernal
May 15 2005
parent reply David L. Davis <SpottedTiger yahoo.com> writes:
In article <d68nnv$kte$1 digitaldaemon.com>, Carlos Santander says...
David L. Davis escribió:
 In article <d6804u$5g2$1 digitaldaemon.com>, Carlos Santander says...
 
Does anybody know how to make that conversion?

-- 
Carlos Santander Bernal
I'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.
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 Bernal
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.html
May 15 2005
parent Carlos Santander <csantander619 gmail.com> writes:
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.html
Thanks 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