Re: [Gambas-devel] Gambas 3.10 - gb.web.feed
Brought to you by:
gambas
|
From: Benoît M. <ga...@us...> - 2017-07-28 14:16:10
|
Le 28/07/2017 à 15:57, Tobias Boege a écrit : >> >> Sorry, I forgot to deal with your requests. >> > > And I came back from vacation just recently. As I see 3.10 wasn't released > yet. I'll try to push the changes today, if we can agree on them. > I go to vacation tommorow, and come back next week. So I think I will make the release in a week, so that you have more time. >> You should internally use Gambas date, not strings, as Gambas date are >> internally UTC timestamps. >> >> The trick is that when you make a date with Date(Year, Month, ...), the >> values you are giving are in the local timezone. >> >> This is the reason why I'm substracting Frac(Date(Now)): it moves the date >> to the UTC time zone (as Now is in local time, the fractional part of >> Date(Now) converted to float is the timezone). >> >> Frac(Date(Now)) and -(System.TimeZone / 86400) are the same value (up to the >> 4th decimal digit, because of different precision). >> >> And isn't the timezone mandatory in a RFC822 date? > > Yes, the timezone is mandatory there. > > So, how about this: I make a class called RssDate where I store a UTC-based > timestamp (aka Date) and a timezone string. As I mentioned before, I think > the timezone string is necessary to let the user specify what timezone the > date will be printed in. > > When an RFC822 date is read, I want to have its timezone string and the > timestamp of that date converted to UTC. When an RFC822 date is written, > I take the UTC timestamp and convert it to the string representation in > the timezone that the user wants to print the date in. > > If that sounds reasonable, I can get to work now. > > Regards, > Tobi > Why do you need the timezone part of the RFC822 date as a string? Why not just using Gambas Date and the Date.ToRFC822() / Date.FromRFC822() functions? -- Benoît Minisini |