jimevins / glabels-qt

gLabels Label Designer (Qt/C++)
http://glabels.org
GNU General Public License v3.0
323 stars 89 forks source link

[feature request] Date/Time variables #173

Open EGeyskens opened 2 years ago

EGeyskens commented 2 years ago

Variables for date & time would be useful to include an labels. e.g. $YY for years with 2 digits, $MM for the months, ...

c3kkos commented 2 years ago

### Suggestions (case-sensitive variables names)

### Time

$hh (24-format hours - two digits) $HH (12-format hours - two digits) $AP (ante/post meridian affix - two digits AM | PM) $mm (minutes - two digits) $ss (seconds - two digits)

(to be fetched and freezed at print time)

### Date

$YY (year - last two digits) $YYYY (year - full, four digits) $MM (month - two digits) $DD (day - two digits)

sur5r commented 2 years ago

I would rather vote against reinventing the wheel here and stick to either strftime or QDateTime::toString().

c3kkos commented 2 years ago

I would rather vote against reinventing the wheel here and stick to either strftime or QDateTime::toString().

Well, we need that extra flexibility... There should be no big effort to code values in those var names...

EDIT: i got your point and although it maybe be a little less straightforward, it will suit well. +1