Yes I know, that there is workaround using: substr(strftime('%Y',d),3)

But why not add %y, when it is only 5 lines of source code, take into account 
that %y is supported also by
C strftime() or PHP etc. and it is really useful.

-Laco.

Seriously, what your patch is actually about is to extract the last two
digits out of a four-digit year.  Apart from all the obvious Y2K
problems, there already is a function for that: it's called substr().



Please can any developer do any comment on this request?
Would it be possible to add such support?
Thanks
-Laco.

----- Pôvodná správa -----
Predmet:        [FEATURE REQUEST] support of %y in strftime()
Dátum:  Fri, 21 Sep 2012 14:15:45 +0200
Od:     LacaK <la...@zoznam.sk>
Pre:    sqlite-users@sqlite.org



Hi *,
some month ago I wrote question about possibility to add support of %y (2 digit year) to strftime() function. Patch is very simple (only few lines of code) and I hope, that will be useful for many users. Patch by Alexey is here: http://sqlite.mobigroup.ru/wiki?name=2-digit+year+patch (although I think, that it can be done in a simpler way ... see my comment later) Can you consider please adding such support ? Is this proper place for post such requests ? Can I do something more to add such support ?
TIA
-Laco.

Looking at patch I do not understand, why we add

n += 4;
in case of 'y' ?

I would do:
       case 'W':
+       case 'y':
n++; ...

+        case 'y': {
+          sqlite3_snprintf(3,&z[j],"%02d",x.Y % 100); j+=2;
+          break;
+        }


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

Reply via email to