Better to keep the code simpler and just say that SQLite (and hence Fossil)
does not know about leap seconds.


On Mon, Jul 28, 2014 at 10:49 AM, Jan Nijtmans <jan.nijtm...@gmail.com>
wrote:

> According to <http://en.wikipedia.org/wiki/Leap_second>, the
> following should be perfectly valid:
>
> $ fossil new --date-override 2012-06-30T23:59:60 foo.fossil
> unrecognized date format (2012-06-30T23:59:60): use "YYYY-MM-DD
> HH:MM:SS.SSS"
>
> Suggested patch to fossil (and SQLite trunk, with adapted test-case):
>
> Regards,
>       Jan Nijtmans
>
> Index: src/sqlite3.c
> ==================================================================
> --- src/sqlite3.c
> +++ src/sqlite3.c
> @@ -14769,11 +14769,11 @@
>      return 1;
>    }
>    zDate += 5;
>    if( *zDate==':' ){
>      zDate++;
> -    if( getDigits(zDate, 2, 0, 59, 0, &s)!=1 ){
> +    if( getDigits(zDate, 2, 0, 60, 0, &s)!=1 ){
>        return 1;
>      }
>      zDate += 2;
>      if( *zDate=='.' && sqlite3Isdigit(zDate[1]) ){
>        double rScale = 1.0;
>
>
> Index: src/date.c
> ==================================================================
> --- src/date.c
> +++ src/date.c
> @@ -175,11 +175,11 @@
>      return 1;
>    }
>    zDate += 5;
>    if( *zDate==':' ){
>      zDate++;
> -    if( getDigits(zDate, 2, 0, 59, 0, &s)!=1 ){
> +    if( getDigits(zDate, 2, 0, 60, 0, &s)!=1 ){
>        return 1;
>      }
>      zDate += 2;
>      if( *zDate=='.' && sqlite3Isdigit(zDate[1]) ){
>        double rScale = 1.0;
>
> Index: test/date.test
> ==================================================================
> --- test/date.test
> +++ test/date.test
> @@ -64,13 +64,14 @@
>  datetest 1.23 julianday(12345.6) 12345.6
>  datetest 1.23b julianday('12345.6') 12345.6
>  datetest 1.24 {julianday('2001-01-01 12:00:00 bogus')} NULL
>  datetest 1.25 {julianday('2001-01-01 bogus')} NULL
>  datetest 1.26 {julianday('2001-01-01 12:60:00')} NULL
> -datetest 1.27 {julianday('2001-01-01 12:59:60')} NULL
> +datetest 1.27 {julianday('2001-01-01 12:59:61')} NULL
>  datetest 1.28 {julianday('2001-00-01')} NULL
>  datetest 1.29 {julianday('2001-01-00')} NULL
> +datetest 1.30 {julianday('2001-01-01 12:59:60')} 2451911.04166667
>
>  datetest 2.1 datetime(0,'unixepoch') {1970-01-01 00:00:00}
>  datetest 2.1b datetime(0,'unixepoc') NULL
>  datetest 2.1c datetime(0,'unixepochx') NULL
>  datetest 2.1d datetime('2003-10-22','unixepoch') NULL
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to