Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Date Format Not Display Correctly

Avatar

Level 1

Hi Expert,

I realy need help on my date format not display correctly. My FormCalc coding is as below :

$.rawValue = num2date(date(), "YYYY-MM-DD")

But the output is DD/MM/YYYY

I tried to Change the coding to

$.rawValue = num2date(date(), "MM-DD-YYYY") and

$.rawValue = num2date(date(), "YYYY/MM/DD")

And it wokirng fine but i need to display with YYYY-MM-DD

Anybody can help??

2 Replies

Avatar

Level 10

Hi,

a date field has 4 main categories for patterns (View, Edit, Validate and Data).

Those patterns are used to format a date in a desired way such as "MM-DD-YYYY".

You can add such patterns in the Object palette under the Field tab or from the context menu by right-clicking your date field.

The view pattern describes how the date is displayed once the field is filled.

If it is blank it uses the local default pattern which may not be the one you prefer.

For each category you can use different patterns.

So you can use the edit pattern date{DDMMYYYY} to enter todays date as 15082012 und format it with the edit pattern date{M/D/YYYY} into 8/15/2012.

Avatar

Level 1

i'm try to use $.rawValue = num2date(date(), "YYYY-M-DD") and its work