How to write date format macro expression for label form control

'dipo Majekodunmi asked on June 28, 2016 19:17


Not sure if this is the right approach. I want to display just the day and month name for a date field in the user profile display form (Display profile (Intranet) (Alternative form)). I changed the form control to a label and trying to use the output format field to format the date.

{%ToDateTime(Value).ToString("MMMMM") + " " + Value.Day#%}

I tried this but it doesn't work. Would appreciate every help.

Correct Answer

Anton Grekhovodov answered on June 28, 2016 19:57


I've answered on the same questions here ToShortDateString() Macro Method Formatting

So you can use the following macro:

{% String.FormatString("{0:MMMM}", Value) + " " + Value.Day %}
0 votesVote for this answer Unmark Correct answer

Recent Answers

Roman Hutnyk answered on June 28, 2016 19:38

Looks like there is no macro method that returns month name, so you can show either month as a number or have to implement your custom macro.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.