cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IKinal
Frequent Visitor

Date formatting

Is there any way to change the formatting that the CurrentDateTime function outputs? The default seems to be to output dates without a leading zero (i.e. April is represented with just '4'). However, my web form that I am trying to automate is strict and requires a leading zero for month and day numbers (i.e. April needs to be represented with '04').

 

Any insights much appreciated.

1 ACCEPTED SOLUTION
5 REPLIES 5
Tejashree_G
Helper I
Helper I

using "get current date and time " action you will get current time and date with dd-MM-yyyy format for ex: today's date is "21-04-2021 and time" like this

Tejashree_G_0-1618997697654.png

this is just a example

Unfortunately, I need just the date, without the time. Even though I selected to retrieve the current date only, it still stores an empty time, just like in your screenshot. In order to get around this, I tried to reconstruct the date manually, but CurrentDateTime.Month returns '4', instead of '04'. My web application is rejecting this.

IKinal
Frequent Visitor

Thanks - that gave me the ability to convert the date into the exact format that I needed.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Top Kudoed Authors
Users online (1,549)