Converting Date format in PeopleCode based on Locale/Personalizations

The following code snippet can be used to convert a Date format specific to the current user’s personalization or locale settings


&sUserOption = %Session.RegionalSettings.DateFormat;

Evaluate &sUserOption
When = 0
&dateFormat = String("M/d/y");
Break;
When = 1
&dateFormat = String("d/M/y");
Break;
When = 2
&dateFormat = String("Y/M/d");
Break;
End-Evaluate;

&from_Dt = DateTimeToLocalizedString(&fromDt, &dateFormat);
&to_Dt = DateTimeToLocalizedString(&toDt, &dateFormat);

Interesting! 🙂

Advertisements

About Manikandan Surendren

A PeopleSoft Techno-functional Consultant. An engineering graduate in Computer Science. Technology Enthusiast. Movie freak. Gadget geek.
This entry was posted in Code, PeopleSoft. Bookmark the permalink.

One Response to Converting Date format in PeopleCode based on Locale/Personalizations

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s