function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
huniversehuniverse 

put current DateTime on page

Hi

 

I want to display current Date and time on apex page. currently  i am using following code

 

Task t = new Task();
         Date myDate = Date.Today();
         DateTime d = t.activityDate;
         public Task getTask() { return t; }

 

<apex:inputField id="PutDate" value="{!task.activityDate}"/>

 

 

it shows calender and current Date. I require to display date and time 12/16/2010 08:10 PM

 

Kindly suggest any idea, code , links.

 

 

Thanks in advance.

Pradeep_NavatarPradeep_Navatar

For visual force page you can use NOW() function to show current date & time.

 

<apex:outputText value=”{!NOW()}”/>

huniversehuniverse

Thanks for reply.

 

I want to display date time in input field. currently it display date only. My question is how to display date and time both

e.g., 12/17/2010 HH:MM like format in inputfield. Please suggest any idea.

 

 

Thanks in advance