How to get current date in pega, YY-mm-dd format

Viewed 1945

I want to get current system date in pega (Year-Month-Date)

YYYY-mm-dd

format.

2 Answers

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.

Related