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

Convert the current date to date pattern like MM/DD/YY based on user locale.
I have a situation where i will get the user locale date in APEX using
DateTime dateTimeToFormat = DateTime.valueOf( value );
Date dateToFormat = dateTimeToFormat.date();
String formattedDatewithUSER_LOCALE = dateToFormat.format();
For example, if the localecode is en_US and timezoneid is America/Los_Angeles, then the date i would get is 9/1/2016.
In my java code, i would get all this info along with date, locale, time zone. Along with this, i would get a date like 2016-09-01 18:42:37 as input and the requirement is to format the input date to the user date based on the locale, timezone.
Any sugesstions..?
DateTime dateTimeToFormat = DateTime.valueOf( value );
Date dateToFormat = dateTimeToFormat.date();
String formattedDatewithUSER_LOCALE = dateToFormat.format();
For example, if the localecode is en_US and timezoneid is America/Los_Angeles, then the date i would get is 9/1/2016.
In my java code, i would get all this info along with date, locale, time zone. Along with this, i would get a date like 2016-09-01 18:42:37 as input and the requirement is to format the input date to the user date based on the locale, timezone.
Any sugesstions..?
try this formate
Thanks
Please let me inform if it work :)
Try this
https://salesforcefeed.wordpress.com/2017/05/25/locale-conversion-and-the-formatting-of-the-datetime-fields-in-visualforce/
Thanks
Please let me inform if it work :)