I want to get current system date in pega (Year-Month-Date)
YYYY-mm-dd
format.
Using
@(Pega-RULES:DateTime).getCurrentDateStamp()
can get current system date in YYYY-mm-dd(Year-Month-Date) format.
The below, assigned to a Text property, gives date in format yyyyMMdd
:
@(Pega-RULES:DateTime).getCurrentDateStamp()
Adjusting solution given here as below, would give the desired format yyyy-MM-dd
:
@FormatDateTime(@CurrentDateTime(),"yyyy-MM-dd","America/NewYork","en_US")
Tested on Pega Personal Edition 8.6.0 using Operator with Default locale "en_US" and Time zone America/New_York.
Use this function
@FormatDateTime(@CurrentDateTime(),"MM/dd/yyyy","America/NewYork","en_US")