Explore Courses Blog Tutorials Interview Questions
0 votes
in Salesforce by (11.9k points)

How do I print the current date on Visualforce?

Stuff like Today(),, doesn't work.

Haven't been able to find any documentation or stackoverflow questions regarding this subject.

1 Answer

0 votes
by (32.1k points)

You need to create a property in your controller like:

public Date Today { get { return; }}

When you're using the VF page, use the following piece of code:

<apex:outputText value="{0,date}">

    <apex:param value="{!Today}" />


Browse Categories