You need to sign in to do that
Don't have an account?
karthikeya 2
String to DateTime conversion ?
Hi all.
i am getting the time formate as "2016-03-03T01:09:36.933" from external system, its EST time.
i need to convert as local time.
ex: MM/DD/YYYY HH:MM
note time should be exactly shown in the formate no changes like Zeros should come.
Thanks in Advance.
i am getting the time formate as "2016-03-03T01:09:36.933" from external system, its EST time.
i need to convert as local time.
ex: MM/DD/YYYY HH:MM
note time should be exactly shown in the formate no changes like Zeros should come.
Thanks in Advance.
format()
Converts the date to the local time zone and returns the converted date as a formatted string using the locale of the context user. If the time zone cannot be determined, GMT is used.
format(dateFormatString)
Converts the date to the local time zone and returns the converted date as a string using the supplied Java simple date format. If the time zone cannot be determined, GMT is used.
format(dateFormatString, timezone)
Converts the date to the specified time zone and returns the converted date as a string using the supplied Java simple date format. If the supplied time zone is not in the correct format, GMT is used.
formatGmt(dateFormatString)
Returns a Datetime as a string using the supplied Java simple date format and the GMT time zone.
These mgith be helpful.
https://developer.salesforce.com/docs/atlas.en-us.200.0.apexcode.meta/apexcode/apex_methods_system_datetime.htm#apex_System_Datetime_formatGmt
Thanks
Sandeep Singhal
For it, you can use JSON.deserialize method
If your question is answered, please mark a Best Answer. If you need more help, please add more details.
Thanks,
Alex
and i need AM/PM after the date also
use below code:
String sDate = String.ValueOf('DATEGETBYACTIONSUPPORT or DATEGETBYACTIONFUNCTION');
System.Debug('sDate: ' + sDate);