Idea

Przemyslaw Pasich avatar image
0 Likes"
Przemyslaw Pasich suggested

Single digit month as an option in DateTime.toString()

Can we please have single-digit month option (1-12) added as one of the formatting options for DateTime.toString() that would be analogous to %e? According to the documentation, the current options are:

month-options-for-datetime-tostring.png

%m returns a double digit version, i.e. April -> 04.


The current workaround would be to construct the month number as a separate string that would then be concatenated with the rest of date string, which is not the prettiest solution:

DateTime ts = Model.dateTime;
string month_str = string.fromNum(ts.month);
string date_str = month_str + "/" + ts.toString("%e/%Y");
datetimeformatting
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

No Comments

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.

Related Ideas