Salesforce提供了关于日期的标准函数,可以在vf页面中直接调用。
而无需在controller中进行赋值。
代码如下:
<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>