chathura
chathura

Reputation: 105

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

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

YYYY-mm-dd

format.

Upvotes: 2

Views: 5696

Answers (3)

Aeturi Seshadri
Aeturi Seshadri

Reputation: 1

Use this function

@FormatDateTime(@CurrentDateTime(),"MM/dd/yyyy","America/NewYork","en_US")

Upvotes: 0

Maciek
Maciek

Reputation: 121

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.

Upvotes: 0

chathura
chathura

Reputation: 105

Using

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

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

Upvotes: 2

Related Questions