#1 2018-11-10 23:52

smw
Member
Registered: 2007-01-15
Posts: 3

Date Format with AM/PM changed since v6.0

Hey there, it appears that the way the "am/pm" functionality works in ReNamer has changed slightly. In previous versions, I could do the date format shown below and it would have the hour in the first portion be 24-hour format, but the hour in the second (user-friendly) portion be 12-hour format. In version 6.9, it formats all hours in the string to 12-hour, not just the hour immediately preceding the "am/pm".

Date Format:  yyyy.mm.dd_hh.nn.ss (ddd, mmm d, yyyy @ h.nn.ss am/pm)
Old Example:  2015.06.05_14.35.57 (Sat, Jun 5, 2015 @ 2.35.57 pm)
6.9 Example:  2015.06.05_02.35.57 (Sat, Jun 5, 2015 @ 2.35.57 pm)

I'd like to keep the front portion 24 for chronological order, and the end portion 12 for readability. Is there a way to do that?

Thanks!
Sean

Offline

#2 2018-11-11 01:19

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Re: Date Format with AM/PM changed since v6.0

You are correct.

Prior to ReNamer v6.0, the "am/pm" and "a/p" specifiers affected only the immediately preceding "h" and "hh" specifiers, instead of all "h" and "hh" specifiers. This change has now been documented on the Date and Time format wiki article.

That is not an intentional change, but rather a consequence of migrating to a different development environment. There is no easy way of reverting this behaviour.

You have few options:
1) Use an older version of ReNamer, prior to v6.0.
2) Use the Pascal Script rule to insert the desired date/time twice, but each time with a different format, e.g. using CalculateMetaTagFormat or FormatDateTime functions.
3) Apply the 12/24 hours conversion where needed, using Regular Expressions or Pascal Script.

In future, there will an additional option. It is planned to implement parameters for the meta tags, which would allow specifying custom date/time format for the relevant meta tags.

Last edited by den4b (2018-11-11 01:23)

Offline

Board footer

Powered by FluxBB