mktime/2 issue

View: New views
2 Messages — Rating Filter:   Alert me  

mktime/2 issue

by Tony Wilson-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I hate to state the obvious but is your local time not set to UTC +2. I
see you are in Belgium which I believe is +1. 'less /etc/timezone' will
let you know. The Yap manual does state (correctly) that the hour is in
local time, so to use 1970,1,1,0,0,0 you would have to have local time
set to UTC.

Regards,
Tony,
Durban, South Africa

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users

Re: mktime/2 issue

by jos.deroo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the explanation and I have compensated for the offset (which I think
is still strange as it is 2 hours whereas the local time offset is only 1hour, but anyhow)
in the datetime/1 production in http://eulersharp.sourceforge.net/2006/02swap/euler.yap
i.e.

datetime(A) -->
        int(B), "-", int(C), "-", int(D), "T", int(E), ":", int(F), ":", decimal(G), timezone(H),
        {(B >= 1970 -> I = B, J = 0; I = 1970, J is 1970-B), mktime(datime(1970,1,1,24,0,0),K), L is 86400-K,
        mktime(datime(I,C,D,E,F,L),M), A is round(M)+G-H-J*31556952}.

and now we get

   ?- phrase(datetime(X),"1970-01-01T00:00:00").
X = 0.0 ?

anywhere and anytime :)

Kind regards, Jos

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618
http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium
http://www.agfa.com/healthcare


Tony Wilson <soduktile@...>

01/07/2009 02:21 AM

To
yap-users@...
cc
Subject
[Yap-users]  mktime/2 issue






I hate to state the obvious but is your local time not set to UTC +2. I
see you are in Belgium which I believe is +1. 'less /etc/timezone' will
let you know. The Yap manual does state (correctly) that the hour is in
local time, so to use 1970,1,1,0,0,0 you would have to have local time
set to UTC.

Regards,
Tony,
Durban, South Africa

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users



------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users