Subject: Re: GetTimeZoneDiff() documentation missing From: Camille Kater Date: Tue, 17 Jun 2014 09:30:08 +0200 Message-ID: <1402991069_7@vo.lu> References: <1402661063_1@vo.lu> <1402933274_5@vo.lu> Lines: 107 NNTP-Posting-Host: 188.115.14.175 Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!news.vo.lu!not-for-mail Newsgroups: comp.lang.clipper.visual-objects X-Trace: vo.lu 1402991069 188.115.14.175 (17 Jun 2014 09:44:29 0200) User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 140616-0, 16/06/2014), Outbound message X-Antivirus-Status: Clean Xref: csiph.com comp.lang.clipper.visual-objects:6972 Hi Jamal, Many thanks. It works for me. I can extract the date/time from a Unix timestamp I got via mail. Now I must do the inverse: translate a date/time into a Unix timestamp in order to reply to the mail. How can I do that ? Again many thanks for your help. Camille On 16/06/2014 20:08, Jamal wrote: > Hi Camille, > > Based on Karl-Heinz functions, here is some code that may help. See my > other post with the modifications. > > The sample below returns both current Epoch Time and todays's date and > current time. > > How does it work for you? > > Jamal > > > FUNCTION Start() > TestEpoch() > WAIT > > return nil > > function TestEpoch() as void pascal > > local nHours as int > local nMinutes as int > local nSeconds as int > local aDateTime as array > local iEpoch as int > local cTime24 as string > > cTime24 := Time24() > nHours := Val(SubStr3(cTime24, 1,2)) > nMinutes := Val(SubStr3(cTime24, 4,5)) > nSeconds := Val(SubStr3(cTime24, 6,7)) > > iEpoch := WinDateTime2UnixDateTime(Today(), nHours, nMinutes, > nSeconds, false) > > ? "Epoch Time", iEpoch > > aDateTime := UnixDateTime2WinDateTime(iEpoch, false) > > ? "UTC/GMT Time", aDateTime[1], aDateTime[2] > > aDateTime := UnixDateTime2WinDateTime(iEpoch, true) > ? "Local Time: ", aDateTime[1], aDateTime[2] > > > RETURN > > "Camille Kater" wrote in message news:1402933274_5@vo.lu... > > Hi Karl-Heinz, > > I would be very interested in those VO functions. > Thanks > > Camille > > > On 15/06/2014 18:27, Karl-Heinz wrote: >> Hi Jamal, >> >>> I wrote some VO function to do the Unix Epoch time conversion which I >>> am still testing for accuracy for different time zones and daylight >>> savings. I did not have to use the GetTimeZoneDiff(). >> >> yes, i doubt that GetTimeZoneDiff() does anything useful. Assuming the >> func should return the bias in hours, it should return in a german >> environment -2, (UTC+01:00 + 1 hour daylight ). But if it would work as >> one might expect it would fail in timezones like "Adelaide UTC+09:30 ". >> In such cases the minutes are truncated because GetTimeZoneDiff() is >> declared as INT. Anyway, are you using in your VO code >> "SystemTimeToTzSpecificLocalTime" and "TzSpecificLocalTimeToSystemTime" >> to calc unix- <> windows-datetimestamps ? It seems that both funcs do >> not require any TimeZone calculations, and that they are smart enough to >> use automatically the correct bias on a given date. If you are >> interested iŽll put some VO snippets based on both funcs together. >> >> regards >> Karl-Heinz >> >