2012-01-31 60 views

回答

5

在你的控制器,创建一个属性:

public Date Today { get { return Date.today(); }} 

在VF页,请尝试使用:在格式化日期

<apex:outputText value="{0,date}"> 
    <apex:param value="{!Today}" /> 
</apex:outputText> 

细节可以发现herehere

16

Visualforce也有数据和时间函数,您可以使用{!NOW()}或{!TODAY()}。

欲了解更多详情,请去here

+0

我认为这个答案是迄今为止最好的。 – 2012-09-04 22:26:51