You need to sign in to do that
Don't have an account?
Damien_
DateTime formatting issues with Time Zones
currently I have
DateTime.now().format('MM/dd/yyyy hh:mm a', 'EST');
but I would like to have
DateTime.now().format('MM/dd/yyyy hh:mm a', 'ET');
The issue is that when I put ET as the timezone it defaults the timezone to GMT since ET is not a correct time zone. How do I accomplish this?
All Answers
Can you tell us what timezone ET is intended to represent?
Eastern Time (ET)
ET isn't a valid timezone as far as Java is concerned - is there a reason why EST doesn't handle this for you?
I believe EST uses daylight savings and ET doesn't. The client specifically asked me to display time as ET and not EST.
Hmmmm I think this is what I was thinking of. Thank you!
Could you show me how to adjust or format system date time to YYYY/MM/DD hh:mm:ss. Now my salesforce only display datetime field as YYYY/MM/DD hh:mm without second.
I would assume all you need to do is add the :ss
DateTime.now().format('MM/dd/yyyy hh:mm:ss a', 'US/Eastern');