You can represent time zones as integers by using minutes. Examples: +600 for AEST, +330 for IST, -480 for PST. No string manipulation is needed, but depending on what or if you're using libraries, you may need extra steps in there for convert those values into a representation supported by the library.
On 30 July 2014 10:47, Will Fong <w...@digitaldev.com> wrote: > Hi, > > On Wed, Jul 30, 2014 at 8:38 AM, Simon Slavin <slav...@bigfraud.org> > wrote: > > Store their timezones in the format "[+-]HH:MM" and apply them by > appending that text to any dates they provide. See the "Time Strings" > section of > > I can store each user's timezone setting as "[+-]HH:MM". But I can > only apply that to GMT values. So when I'm reading from the database, > it's a trivial operation. > > However, if a user specifies a datetime, I would have to provide the > reverse of that value to convert the user time into GMT. It would be a > bit easier (yet still messy) if the timezone was just an integer, then > I could just "*-1". But the ":MM" seems to make it a messy string > operation. > > Is this the only option? It seems like there would have been a > "better" way to handle this. > > Thanks, > -will > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users