...segue ancora...
« Isn't unix time independent of timezones (it always uses UTC)?
Can you use it?
$ date +%s
Jussi »
« OK... You must understand that Gambas stores all date/time in UTC
internally. The timezone is applied only when converting that date/time
to a string.
So you can safely exchange date/time between your client and your server
by using the WRITE instruction or by converting the date/time to a
number with CFloat() before exchanging it.
Regards,
--
Benoît Minisini »
« The date/time is sent/received as a float and stays synchronized. The
problem is (as you say) when the float is converted to a string the time
zone is applied. I need a way to print
Format$(CDate(DateCurrent), "mmmm d, yyyy, hh:nn:AM/PM")
without the time zone being applied, or with a specific TZ applied.
"DateCurrent" is the float. I'm trying not to custom create a calendar
and complicate Format$ with it, but specify a time zone. The server is
fine, but the client applies local TZ and DST rules and fouls the
formatting of Format$.
Hope that makes sense, and thanks.
Kevin Fishburne »
« Presumably the float is seconds since epoch or similar.
so calculate the difference between the local time and server time in seconds
and subtract it from the float value before display, this
"counteracts" the time zone
adjustment applied by the client OS
Ian »
« To get the current timezone, you do Round(Frac(Date(Now)) * 24). Then
you can use this value to convert a date to/from UTC.
Regards,
--
Benoît Minisini »
« So scatterbrained... I have added System.TimeZone property for a while.
It returns the interval with UTC in seconds (for example, -3600 in
France currently).
Regards,
--
Benoît Minisini »