Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Current Date Custom Object Output Format

Avatar

Former Community Member
i am unable to change the Current Date Custom Object form mm/dd/yy.



Any suggestions.
4 Replies

Avatar

Level 2
I assume that you get this from Insert/Custom/Current Date???



You need to change the # in the script to match the format you want...



According to the Adobe help files...(search DateFmt)



The following expressions are examples of using the DateFmt function:



DateFmt(1) returns - M/D/YY (if en_US locale is set)

DateFmt(2, "fr_CA") returns - YY-MM-DD

DateFmt(3, "de_DE") returns - D. MMMM YYYY

DateFmt(4, "fr_FR") returns - EEEE D' MMMM YYYY



I don't know if you can customize it further or not...



Jenn D.

Avatar

Former Community Member
Thanks Jenn.



Although I don't do scripting I was able to figure it out.



Works fine.

Robert

Avatar

Former Community Member
Please let me know how you got it to work.



It's been driving me crazy - I've been going through the 'help' and tried it all - but I need the format to be MM/DD/YY - 01/09/09 - it needs to have the zeros.

Avatar

Former Community Member
I GOT IT!!!!



Num2Date(Date(), "MM/DD/YY")



CURRENT DATE FORMATED: MM/DD/YY 01/09/09