2

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

YYYY-mm-dd

format.

chathura
  • 105
  • 1
  • 9

3 Answers3

2

Using

@(Pega-RULES:DateTime).getCurrentDateStamp()

can get current system date in YYYY-mm-dd(Year-Month-Date) format.

chathura
  • 105
  • 1
  • 9
0

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.

Maciek
  • 111
  • 1
  • 3
0

Use this function

@FormatDateTime(@CurrentDateTime(),"MM/dd/yyyy","America/NewYork","en_US")
Syscall
  • 19,327
  • 10
  • 37
  • 52