Suggesting addition of two new modifiers to SQLITE Date Time functions. Add new modifier(14):javams and modifier(15):javanano similar to unixepoch modifier but extended to support milliseconds and nanoseconds.
The "javams" modifier (14) only works if it immediately follows a timestring in the DDDDDDDDDDDDD format. This modifier causes the DDDDDDDDDDDDD to be interpreted not as a Julian day number as it normally would be, but as JAVA Millisecond Time - the number of milliseconds since 1970. If the "javams" modifier does not follow a timestring of the form DDDDDDDDDDDDD which expresses the number of milliseconds since 1970 or if other modifiers separate the "java" modifier from prior DDDDDDDDDDDDD then the behavior is undefined. Due to 13 digit precision limitation the "javams" modifier only works for dates between 1653-02-10 06:13:21.001 and 2286-11-20 17:46:39.999 (java times of -9999999999999 through 9999999999999). The "javanano" modifier (15) only works if it immediately follows a timestring in the DDDDDDDDDDDDDDDDDDD format. This modifier causes the DDDDDDDDDDDDDDDDDDD to be interpreted not as a Julian day number as it normally would be, but as JAVA Nano Second Time - the number of NanoSeconds since 1970. If the "javanano" modifier does not follow a timestring of the form DDDDDDDDDDDDDDDDDDD which expresses the number of nanoiseconds since 1970 or if other modifiers separate the "java" modifier from prior DDDDDDDDDDDDDDDDDDD then the behavior is undefined. Due to precision limitations imposed by the implementations use of 64-bit integers the "javanano" modifier only works for dates between 1677-09-21 00:12:44.145224192 and 2262-04-11 23:47:16.854775807 (javanano times of -9223372036854775808 through +9223372036854775807). These modifier additions will allow easier and seamless support for storing high resolution times in the database and enhance functionality for manipulation. Presently we are able to store and use "javams" format via concatenation: javams format strftime('%s','now')||substr(strftime('%f','now'),-3,3) strftime('%Y-%m-%d %H:%M%S',field/1000,'unixepoch')||substr(strftime('%f','field),-3,3) We do not use javanano format presently but are merely suggesting it as a possibility for completeness. javanano format strftime('%s','now')||substr(strftime('%f','now'),-3,3)||'000000' //'now' limited to millisecond precision strftime('%Y-%m-%d %H:%M%S',field/1000,'unixepoch')||substr(strftime('%f','field),-9,9) JavaMS support is a higher priority than JavaNano. Any Thoughts or Input on this matter? _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users