cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Demuris
New Member

Date format conversion

I am trying to set up a power automate flow to move a file from one directory to another.  The file that I am moving has a naming convention that is consistent with the exception of the date attached for each day the file is generated.  

In theory this is fairly simple, here are the steps I am taking.
1. Get current date and time - Variable result = 11/24/2022 12:00:00 (I suspect Power Automate is adding the time but should not be since I am only asking for the date to be retrieved)

2. convert datetime to text - Variable result = 11/24/2022

3. format date - Variable result = 20220024 which is incorrect(YYYYMMDD)

The same result occurs when I change the format to MMDDYYYY or MM/DD/YYYY

 

I am sure I am missing something simple but Any help to a fix would be greatly appreciated

 

Thank You,

Demuris 

1 ACCEPTED SOLUTION

Accepted Solutions
Sundeep_Malik
Community Champion
Community Champion

Hey @Demuris 

 

Actually whats happening is you are using Lower mm for getting month. But lower mm are used for minutes. 

To get month you will have to write capital MM.

 

so your expression should look like:

 

yyyyMMdd

 

Sundeep_Malik_0-1669365700007.png

 

Sundeep_Malik_1-1669365718327.png

 

Sundeep_Malik_2-1669365733589.png

 

Sundeep_Malik_3-1669365752621.png

 

View solution in original post

2 REPLIES 2
Sundeep_Malik
Community Champion
Community Champion

Hey @Demuris 

 

Actually whats happening is you are using Lower mm for getting month. But lower mm are used for minutes. 

To get month you will have to write capital MM.

 

so your expression should look like:

 

yyyyMMdd

 

Sundeep_Malik_0-1669365700007.png

 

Sundeep_Malik_1-1669365718327.png

 

Sundeep_Malik_2-1669365733589.png

 

Sundeep_Malik_3-1669365752621.png

 

Demuris
New Member

Thank you, I figured it was something simple that I was overlooking.  Appreciate the support!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,678)