[QGIS-Developer] format_date() expression function and milliseconds

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[QGIS-Developer] format_date() expression function and milliseconds

Raymond Nijssen
I'm trying make a label showing milliseconds and wonder if QGIS handles
these correctly.

The docs say:

z: the milliseconds without leading zeroes (0 to 999)
zzz: the milliseconds with leading zeroes (000 to 999)

I think the docs should say 'with/without **trailing** zeroes.

Here some examples:

format_date('2012-05-15 01:23:45.000', '.zzz  .z') --> '.000  .0'
format_date('2012-05-15 01:23:45.001', '.zzz  .z') --> '.001  .001'
format_date('2012-05-15 01:23:45.010', '.zzz  .z') --> '.010  .01'
format_date('2012-05-15 01:23:45.100', '.zzz  .z') --> '.100  .1'

Should I change the docs? Or am I wrong?

BTW, the option 'without leading zeroes' does not exist and could be
useful. Of course you can use to_string(to_int()) here but it is less

Kind regards,
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer