Re: Other information and dates of an archive

new topic     » goto parent     » topic index » view thread      » older message » newer message

Sergio Gelli wrote:
> 
> CChris wrote:
> 
> > Btw, Sergio, that is exactly what my "orientation" was....
> > 
> > CChris
> 
> 
> OK, CCris, I made plus some changes and finally I am getting the dates 
> modified, created and last access. 
> 
> But, look at below the behavior of the EuCode with GTMs different, 
> Greenwich and Bras�a: 
> 
> 
> windows explorer dates with GTM = greenwich
> modified= 2007/02/03 08:55
> creation= 2007/02/03 18:18
> accessed= 2007/02/03 00:00 
> 
> Eucode dates with GTM = Greenwich
> modified= 2007/02/03 08:55
> creation= 2007/02/03 18:18
> accessed= 2007/02/03 00:00  
> 
> windows explorer dates with GTM = -03:00= Brasília
> modified= 2007/02/03 08:55
> creation= 2007/02/03 18:18
> accessed= 2007/02/04 00:00 
> 
> Eucode dates with GTM = -03:00= Brasília
> modified= 2007/02/03 10:55
> creation= 2007/02/03 20:18
> accessed= 2007/02/03 02:00  
> 
> However, the GTM is not being considered and this results in differences 
> in the value of the hours. 
> 
> It is probable that we will have that to find which GTM is being used 
> and to make additions or reductions in the value of the hour to show 
> it correctly. 
> 
> But how meeting the value of the GTM in the machine that the Eucode is 
> running?  
> 
> Many thanks again,
> 

[snipped code]
This information is in the time zone system info. You'll have to do some 
more define_c_ and peeks (see, not that difficult eh?):

-- wrap the relavant function from kernel32
constant kernel32=open_dll("kernel32.dll"),
gtzi=define_c_func(kernel32,"GetTimeZoneInformation",{C_POINTER},C_ULONG),
-- and get some storage for a TIME_ZONE_INFO structure
         tzi=allocate(172)
integer rc,bias,std_bias,svt_bias
-- fill the structure
rc=c_func(gtzi,{a})
-- rc may be an error code, or say if we are in std time, xaving time or don't
know
bias=peek4s(a)
std_bias=bias+peek4s(a+84) -- usually = bias
svt_bias=bias+peek4s(a+168)
-- free memory
free(a)


After this, std_bias is the number of minutes that you have to add to your 
local standard time to get GMT time. svt_bias holds the number of minutes 
that separate your daylight savings time from GMT.
On your machine, I'd expect values of 180 and 120 respectively.
Divide the values by 60 to get the values in hours. These are the 
corrections Windows Explorer applies in reverse to display dates/times in 
user time.
The remainder of the structure is made of the name of the times (standard 
and savings), and the switch dates between the two modes.
I didn't google for the various return codes; you'll need to look up the 
Win32API doc and google to find out, if you need them.

CChris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu