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.
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.
In your controller, create a property:
public Date Today { get { return Date.today(); }}
In the VF page, try using:
<apex:outputText value="{0,date}">
<apex:param value="{!Today}" />
</apex:outputText>
Visualforce has Data and Time functions too, you can use {!NOW()} or {!TODAY()}.
For more details go here
In your controller, create a property:
public Date Today { get { return Date.today(); }}
In the VF page, try using:
<apex:outputText value="{0,date}">
<apex:param value="{!Today}" />
</apex:outputText>
© 2022 - 2024 — McMap. All rights reserved.