cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KamilAdamczyk Helper V
Helper V

Date and time format

Hi!

I'm not sure is it a bug or I'm doing something wrong.

I need to get UtcNow in format 'M'. Documentation says it will return me month 1 2 3 4. MM should be 01 02 03 04.

I'm using 

formatDateTime(utcNow(),'M') and output is 12 March.
How to get only 3? Not 03.
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Date and time format

Hi @KamilAdamczyk 

 

Please see below

 

image.png

 

The expression I used is as follows:

 

int(formatDateTime(utcNow(),'MM'))
 
formatDateTime(utcNow(),'MM')
 
Run results:
image.png
 
If you convert to int() then it will remove the zeros automatically.
 
Thanks


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Date and time format

sure @KamilAdamczyk  you can use the conector converttimezone.

out.PNGconbert.PNG



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Super User
Super User

Re: Date and time format

Hi @KamilAdamczyk 

 

You can also try following expression :

if(greater(int(formatDateTime(utcNow(),'MM')),9),formatDateTime(utcNow(),'MM'),replace(string(formatDateTime(utcNow(),'MM')),'0',''))
 
-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
 
 
Super User
Super User

Re: Date and time format

Hi @KamilAdamczyk 

 

Please see below

 

image.png

 

The expression I used is as follows:

 

int(formatDateTime(utcNow(),'MM'))
 
formatDateTime(utcNow(),'MM')
 
Run results:
image.png
 
If you convert to int() then it will remove the zeros automatically.
 
Thanks


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

View solution in original post

KamilAdamczyk Helper V
Helper V

Re: Date and time format

That is brilliant!

Thanks!

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,820)