Back
How do I print the current date on Visualforce?
Stuff like Today(), System.now, doesn't work.
Haven't been able to find any documentation or stackoverflow questions regarding this subject.
You need to create a property in your controller like:
public Date Today { get { return Date.today(); }}
When you're using the VF page, use the following piece of code:
<apex:outputText value="{0,date}"> <apex:param value="{!Today}" /></apex:outputText>
<apex:outputText value="{0,date}">
<apex:param value="{!Today}" />
</apex:outputText>
1.2k questions
2.7k answers
501 comments
693 users