function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TMCBATMCBA 

Display date/time stamp on VF page to users in different locales

We have implemented a custom VF page on the Opportunities object that presents the record in a PDF format to users when they click on a custom button. On the VF page, we have a section/group of fields that displays the date/time stamp and user names for the approvals.  The date/time stamp display is visible to users as long as their user locale matches that of our corporate locale (English/United States).
For instance, a user set his locale to Hungarian. He is able to see the expected data values on the PDF except for the date/timestamp detail.  In the SF UI, though, he has access to all the same data on the record.
 
After additional testing, (by changing user locale to various values, logging in as user and viewing the PDF), it appears that Hungarian locale presents a problem while several of the other locales are not an issue.  Has anyone come across issues with the Hungarian locale?

How do we account for the individual user locale settings on our VF page so that the date/time stamps are visible regardless of their locale setting?
Saurabh DhobleSaurabh Dhoble

Since you have not posted your code, I can only point out common pitfalls :-

A. Are you doing any funky concatenation of month/day/year to come up with dates ? E.g., if you are concatenating month/day/year together to come up with the date, that logic will fail in locales that use european date format (dd/mm/yyyy).

B. Try using System.Debug() to output the date value for your field. If you see an invalid value when you change the user locale to hungarian, that is your problem.

 

Please post your code so I can better help identify the problem.