Re: [sqlite] Unrecognized "Z" UTC time zone signifier

2008-02-22 Thread Brian Smith
Wilson, Ron P wrote:
> Heh.  He implemented it with a goto statement!

It is also interesting that the vast majority of the Zulu people do not
live in the "Zulu timezone."

- Brian

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Unrecognized "Z" UTC time zone signifier

2008-02-22 Thread Wilson, Ron P
Heh.  He implemented it with a goto statement!  While I personally have no 
problem with this, especially when it is the most efficient solution, we have a 
client who demands all source code comply with MISRA and I don't relish the day 
we have to defend SQlite and our parser (lemon generated).

Ron Wilson, S/W Systems Engineer III, Tyco Electronics, 434.455.6453


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ralf Junker
Sent: Friday, February 22, 2008 9:09 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Unrecognized "Z" UTC time zone signifier

Aristotle Pagaltzis wrote:

>* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2008-02-21 13:45]:
>> Ralf Junker <[EMAIL PROTECTED]> wrote:
>> > SQLite does not recognize "Z" as the zero offset time zone
>> > specifier. 
>> 
>> If we start accepting any symbolic timezone names, seems like
>> we would then need to start accepting them all.
>Not hardly. FWIW, the IETF recommendation for timestamps in
>any new internet standards is to use the format specified in
>RFCÂ 3339, which is based on codified experience. For time zones,
>it prescribes that they be given as either a numeric offset or
>`Z` a shortcut for `+00`; no provision is made for other symbolic
>names as those only cause trouble. So you should have no trouble
>refusing requests to support those.

Richard did it, and it works like a charm:

  http://www.sqlite.org/cvstrac/chngview?cn=4805

Many thanks!

Ralf  

___
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


Re: [sqlite] Unrecognized "Z" UTC time zone signifier

2008-02-22 Thread Ralf Junker
Aristotle Pagaltzis wrote:

>* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2008-02-21 13:45]:
>> Ralf Junker <[EMAIL PROTECTED]> wrote:
>> > SQLite does not recognize "Z" as the zero offset time zone
>> > specifier. 
>> 
>> If we start accepting any symbolic timezone names, seems like
>> we would then need to start accepting them all.
>Not hardly. FWIW, the IETF recommendation for timestamps in
>any new internet standards is to use the format specified in
>RFCÂ 3339, which is based on codified experience. For time zones,
>it prescribes that they be given as either a numeric offset or
>`Z` a shortcut for `+00`; no provision is made for other symbolic
>names as those only cause trouble. So you should have no trouble
>refusing requests to support those.

Richard did it, and it works like a charm:

  http://www.sqlite.org/cvstrac/chngview?cn=4805

Many thanks!

Ralf  

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Unrecognized "Z" UTC time zone signifier

2008-02-21 Thread Aristotle Pagaltzis
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2008-02-21 13:45]:
> Ralf Junker <[EMAIL PROTECTED]> wrote:
> > SQLite does not recognize "Z" as the zero offset time zone
> > specifier. 
> 
> If we start accepting any symbolic timezone names, seems like
> we would then need to start accepting them all.

Not hardly. FWIW, the IETF recommendation for timestamps in
any new internet standards is to use the format specified in
RFC 3339, which is based on codified experience. For time zones,
it prescribes that they be given as either a numeric offset or
`Z` a shortcut for `+00`; no provision is made for other symbolic
names as those only cause trouble. So you should have no trouble
refusing requests to support those.

Regards,
-- 
Aristotle Pagaltzis // 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Unrecognized "Z" UTC time zone signifier

2008-02-21 Thread Ralf Junker
[EMAIL PROTECTED] wrote:

>Ralf Junker <[EMAIL PROTECTED]> wrote:
>> SQLite does not recognize "Z" as the zero offset time zone specifier. 
>
>SQLite does not currently accept any timezone specifiers, other
>than a hard-coded timezone offset:
>
>   1981-04-06T14:45:15+01:00
>
>If we start accepting any symbolic timezone names, seems like we
>would then need to start accepting them all.  If am reluctant to
>open the floodgates

Yes, I know about your strict policy of adding new features to SQLite, and 
please know that I do appreciate it. But this does not mean we have go give up 
easily on new features, but provide better arguments instead. Let my try:

1. "Z" is part of the ISO standard and therefore used with external date and 
time data. Supporting it makes it much easier to import such data into SQLite.

2. "Z" is not a soft-coded timezone specifier like "CET" or similar. It is just 
a special case of the hard-coded "1981-04-06T14:45:15+00:00".

3. Using "Z" explictly distinguises UTC from local time zones and avoids 
disambiguities.

4. Asking for "Z" I do not want to open any floodgates. If this was my 
intention, I would have asked for 

  * ±[hh][mm] and ±[hh] -- currently missing but nice to have, IMHO
  * named timezones ('MET' or 'Europe/Moscow')  -- just a joke
  * daylight saving time support -- kidding only

Ralf 

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Unrecognized "Z" UTC time zone signifier

2008-02-21 Thread drh
Ralf Junker <[EMAIL PROTECTED]> wrote:
> SQLite does not recognize "Z" as the zero offset time zone specifier. 

SQLite does not currently accept any timezone specifiers, other
than a hard-coded timezone offset:

   1981-04-06T14:45:15+01:00

If we start accepting any symbolic timezone names, seems like we
would then need to start accepting them all.  If am reluctant to
open the floodgates

--
D. Richard Hipp <[EMAIL PROTECTED]>

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Unrecognized "Z" UTC time zone signifier

2008-02-21 Thread Ralf Junker
SQLite does not recognize "Z" as the zero offset time zone specifier. "Z" (for 
'Zulu time', an alternative name for UTC) is part of the ISO 8601 standard for 
date and time representations. See http://en.wikipedia.org/wiki/ISO_8601 for 
details.

In this regard, SQLite does not currently follow the standard and rejects the 
following valid ISO 8601 dates as NULL:

  select datetime ('1981-04-06T14:45:15Z');
  select datetime ('14:45:15Z');

As far as I can tell, "Z" support only requires a very minor change in date.c, 
parseTimezone() to recognize the if the "Z" character is present. No further 
timezone modification is necessray.

A test case scenario would be

  datetest 5.8 {datetime('1994-04-16 14:00:00Z')} {1994-04-16 14:00:00}
  # According to Wikipedia, timezone should directly follow time.
  # SQLite, however, allows whitespace inbetween.
  # Question: Does this conform to ISO 8601?
  datetest 5.9 {datetime('1994-04-16 14:00:00 Z')} {1994-04-16 14:00:00}
  # Whitespace after Z.
  datetest 5.10 {datetime('1994-04-16 14:00:00Z ')} {1994-04-16 14:00:00}
  # Whitespace before and after Z.
  datetest 5.11 {datetime('1994-04-16 14:00:00 Z ')} {1994-04-16 14:00:00}

If "Z" timezone support was implemented, I would volunteer to update the date 
time function documentation in the SQLite Wiki.

Ralf

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users