You need to sign in to do that
Don't have an account?

converting datetime problesm to 12 hours format in apex
The following value is my input
'11/21/2014 15:20:00'
i want to change the above value format like '11/21/2014 03:20 pm'
how to do this any help me
i am getting errors like this "System.TypeException: Invalid date/time: 11/21/2014 15:20:00"
'11/21/2014 15:20:00'
i want to change the above value format like '11/21/2014 03:20 pm'
how to do this any help me
i am getting errors like this "System.TypeException: Invalid date/time: 11/21/2014 15:20:00"
What you need to do is format the date. Why don't you do it this way use Format method to format the date.
Try parsing it using
And then format the myDateTime using Note: Not tested it.
If it helps, please mark this as solved.
Try the following code, it will be usefull for you
<apex:outputText value="{0,date,M/d/yyyy hh:mm a }">
<apex:param value="{!Chat.h_message_sent_on__c}" />
</apex:outputText>
Thanks,
Indy