You need to sign in to do that
Don't have an account?
Terry411
DateTime Format
I'm using a custom controller and having trouble getting the date/time field to display correctly.
<apex:outputLabel value="Class Date" for="ClassDate"/> <apex:inputText id="ClassDate" value="{!ClassDateTime}"/>
The field displays as 'Mon Mar 07 10:20:00 GMT 2011'
I need this to display, in the correct timezone (SCT), with a 'yyyy-MM-dd HH:mm:ss' format.
Try changing apex:inputText to apex:inputField.
I thought an InputField would require a sObject. Is that not the case or is there a way to use an sObject with a custom controller?
Yes, you are correct. You maybe able to use the object field as a variable instead of binding directly to a dataTime variable. This thread may also assist but I'm not sure if it works for input fields: http://boards.developerforce.com/t5/Visualforce-Development/Formatting-Datetime-Objects-in-VisualForce-how-to/m-p/111504#M9820