How to display date in HTML web part

MyPoint CreditUnion asked on October 29, 2014 21:44

How can I grab the current date and display it on the page? For this example I am just using the editable HTML web part and I need to display something like "Offer good from 10/29/14 til 11/30/14" or something like that, but I need the start date to be dynamic (todays date).

In classic ASP I would use something like <%= DanDate(Now(), "%m/%d/%y") %>

I have tried a few things, but only the C# is showed, not the result from the server.

Correct Answer

Brenden Kehren answered on October 29, 2014 23:03

Use a macro in the WYSIWYG editor {% CurrentDateTime @%} Make sure you use the Macro button to initially put your macro in.

0 votesVote for this answer Unmark Correct answer

Recent Answers


MyPoint CreditUnion answered on October 29, 2014 23:04

There we go, I was trying to hand-code it. Not even looking for a button.

Thanks Brenden, you are the best!

0 votesVote for this answer Mark as a Correct answer

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