You need to sign in to do that
Don't have an account?
astro
How to print today's date in visualforce?
I know this is probably a silly question but I'm new to web programming and salesforce/apex/vf and I need to do this but cannot find a way.
I need to be able to simply print today's date on a page. I've tried embedding some javascript in <script></script> tags and that does not seem to do anything at all.
Thank's to all that read
Try this snippet out. Shows example of a few Date related expressions:
<apex:page > Today's full date is: {!TODAY()}<br/> Today's Month is: {!MONTH(TODAY())}<br/> Number Day of the Month: {!DAY(TODAY())}<br/> Current Year: {!YEAR(TODAY())}<br/> </apex:page>
All Answers
Try this snippet out. Shows example of a few Date related expressions:
<apex:page > Today's full date is: {!TODAY()}<br/> Today's Month is: {!MONTH(TODAY())}<br/> Number Day of the Month: {!DAY(TODAY())}<br/> Current Year: {!YEAR(TODAY())}<br/> </apex:page>
Thank you very much aalbert i did not know you could call those functions directly within visualforce!
I appreciate you responding, it was a big help.
Thank's again!
Use the today() or now() expression language function, ie,
<apex:page>
{!today()}
</apex:page>
See the "Operators and Functions" topic in the online help for more similar expression language information.
thank's for that. I didn't realize I could use those operators and functions in that way within vf. Oh, silly me.
Thank you for sharing that.
This is GMT formmated date/time: Or
To get the local time zone, insert a space before the left brace..