Wednesday, May 5, 2010

Date display format on Page

Date display format on Page

In Order to change the date format through Personalization, please follow the steps given below:

1. Navigate, Root > People Tools > Personalization > Personalization Options > Search

Here, you will get the option for the different application for which you want to change the Date Format or you can also choose PPTL (People Tools) which change the Date Format in the Tools itself. Select, PPTL.

2. Now, you can see there is a Definition---> DFRMT, for the Date Format.

3. On the Top of this page and beside the Definition Tab, you will find the Format Tab, just click on this Tab.

4. Now, click on the "Set Option Default Value".

5. Change the Option Default Value as per your requirement MMDDYY and click OK.

6. Save the changes.

========================================
========================================

If you want to change the Date Format for a Specific User on specific page then you can also do this through People Coding.

You can also play with the below code with the help of %oprid, like if %oprid then the below code or w.r.t roles through "IsUserInRole" function.

There is one built-in function "DateTimeToLocalizedString". You can use this if you want to change the date format through people code for your PIA pages.

How to use:

Example 1:
&String = DateTimeToLocalizedString(&Date, "M/d/y");
/* if you are picking the date from any record field and using &Date for that field */

Example 2:
&String = DateTimeToLocalizedString(%Date, "M/d/y");
/* if you want to pick the system date and want to use it on your page with different formats. */

-- Assign this String variable (&String) to your desired field.

Note: Here 'd' for date and 'y' for year both must be in smaller letters only. And, 'M' for months should be in Caps.

1 comment: