Question

How to display Current submission date and Current submission time in YYYYMMDD and HHMMSS formats

Hi,

in an activity, i have two parametrs 1.Current submission date(YYYYMMDD)

2.CurrentSubmissiontime(HHMMSS)

How to display the property values in the above format.

***Updated by Moderator: Marissa to update categories***

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

March 14, 2016 - 6:44am

Hello Praveen,

Please check the below post:

Change Date format to MM/YY

Best Regards,

Mounika

March 14, 2016 - 6:53am
Response to MounikaThatikonda

and Can you please tell me the solution for the Time format...format should be like HHMMSS???

Thanks,

Praveen

March 14, 2016 - 9:43am

Hi Praveen,

          I believe you like to display the Date and Time format in the UI.

         

          1. Add date time control in your section and configure as shown below.

               DateTime.PNG

               similarly for time change the custom format to hh:mm:ss.

         

               The following is the result I got.

               

               Result.PNG

                  Please let me know if my understanding is wrong.

Thanks,

Gowrishankar.

March 14, 2016 - 9:55am
Response to GOWRISHANKAR

Ur understanding is correct...But not in the UI...

We are passing request parameters in an activity...Pls tell How to achieve this for the time stamp..!!!

Capture.PNG

June 28, 2017 - 10:46am
Response to PraveenkumarReddyM

Hi Praveen,

you can use this @DateTime.getCurrentTimeOfDayOnlyStamp() , it will show the time HHMMSS

 

Thanks,

June 28, 2017 - 11:09am
Response to PraveenkumarReddyM

Get the current date and pass to the below function. it will return the required format.

@(Pega-RULES:DateTime).FormatDateTime(Param.{paramname}, "MMM dd',' yyyy HH:mm:ss a", null, "ESTor GMT")

Pega
November 9, 2016 - 8:39am

You can use the same FormatDateTime utility function with patterns defined in "SimpleDateFormat" https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

param.RCVTM=@FormatDateTime(@CurrentDateTime(),"hhmmss","",null)

this should be fine.

February 28, 2018 - 3:52pm

Hello Praveen,

You can try as mentioned below:

@FormatDateTime(@CurrentDateTime(), "yyyyMMdd", "GMT", "")  -- returns date as 20180228

@getCurrentTimeOfDayOnlyStamp() -- returns time stamp as 205013