Re: [sqlite] week number - feature request - extend strftime for ISO week?
PooLpiwrites: > > Thanks MikeW, > > Is there a way to do strftime %W with another function. > It don't seems to be possible with datetime. > > Thanks > > PooLpi The Linux 'date' command does support %G/%g/%V referring to ISO week num, which suggests an extension feature for ISO support. Perhaps an SQLite feature request to add these format specifiers would be looked on favourably, after all, there is a precedent with %f and %J. If using the C API, you could also create your own function to do the job using http://www.sqlite.org/c3ref/create_function.html Regards, MikeW ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] week number
Thanks MikeW, Is there a way to do strftime %W with another function. It don't seems to be possible with datetime. Thanks PooLpi 2009/1/8 MikeW> PooLpi writes: > > > > > Hello, > > > > Happy new year 2009 to the list ;) > > > > I'm working on weeks with Perl (DateTime module) and Sqlite. > > > ...snip... > > The ISO (ISO8601) definition says that the first week containing a > Thursday > > is week #1. > > > > My dates in the database are in this format : -MM-DD > > > > Why Sqlite gives me this #52 week number at the end of 2008? > > > > Thanks in advance, > > > > PooLpi > > > I think you will find that strftime %W quoted in the SQLite docs > (follow the link from http://www.sqlite.org/lang_datefunc.html) > does not use the ISO definition of week number, but rather the > more simplistic Unix one. > > Regards, > MikeW > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- 'Ebry haffa hoe hab im tik a bush'. Jamaican proverb ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] week number
PooLpiwrites: > > Hello, > > Happy new year 2009 to the list ;) > > I'm working on weeks with Perl (DateTime module) and Sqlite. > ...snip... > The ISO (ISO8601) definition says that the first week containing a Thursday > is week #1. > > My dates in the database are in this format : -MM-DD > > Why Sqlite gives me this #52 week number at the end of 2008? > > Thanks in advance, > > PooLpi > I think you will find that strftime %W quoted in the SQLite docs (follow the link from http://www.sqlite.org/lang_datefunc.html) does not use the ISO definition of week number, but rather the more simplistic Unix one. Regards, MikeW ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] week number
Hello, Happy new year 2009 to the list ;) I'm working on weeks with Perl (DateTime module) and Sqlite. With the end of 2008 and the beginning of 2009 : In my database, if i select dates at the end of 2008, it gives me : week #51 => 22-28 dec week #52 => 29-31 dec at the beginning of 2009 : week #0 => 1-4 jan week #1 => 5-11 jan With the Perl and the DateTime, when i iterate from the end of 2008 to the beginning of 2009: week #52 22-28 dec week #1 29 dec - 4 jan week #2 5-11 jan Here it' OK (at least for me ;) The ISO (ISO8601) definition says that the first week containing a Thursday is week #1. My dates in the database are in this format : -MM-DD Why Sqlite gives me this #52 week number at the end of 2008? Thanks in advance, PooLpi -- 'Ebry haffa hoe hab im tik a bush'. Jamaican proverb ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users