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

Convert utcNow to integer

Hi,

 

I'm trying to update the row of the current day in a excel file, but microsoft flow take the dates in the table as number and I don't know how convert the dd/MM/yyyy to a number, how can I do that?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

 

Hi @brayanrm0097 ,

 

You could use the following expression to covert utcNow() to the number like the value stored in the Date column.

div(sub(ticks(formatDateTime(utcNow(),'yyyy-MM-dd')),ticks('1899-12-30')),864000000000)

Then configure this number in Date column as key-value to update the corresponding row.

57.PNG

Please take a try and see if it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Super User III
Super User III

Hello,

Can you share a picture of your flow,

I am wondering what you mean by flow takes dates as a number.

If you mean you are grabbing the dates from excel and the dates are showing as a long number / integer. You can use the expression: addDays()

For example I always use 2 compose actions.
One for storing the excel number date. And one for doing the conversion. Here is an example

addDays('1899-12-30',int(outputs('Compose')),'MM/dd/yyyy')

Copy my expression exactly. Just change the Outputs(‘Compose’) to your dynamic content.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Hi, thanks for answer,

 

I have an excel table with a date column that I want to use for the "Key column" in the excel block, for find the correct row depending of the current day and update the next column.

image.png

 

I tried this simple line for get the current date, but can't use it for the "Key value" because Microsoft flow get date in excel as a number.

 

image.png

Hi,

Is there an error that you are getting when running the flow?
What format is that column in excel (General,Date,Number)

If possible, I would make the column Fecha a General format, and pass the date as a string by using the expression:
string() infringe of your expression you are using now.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




 

Hi @brayanrm0097 ,

 

You could use the following expression to covert utcNow() to the number like the value stored in the Date column.

div(sub(ticks(formatDateTime(utcNow(),'yyyy-MM-dd')),ticks('1899-12-30')),864000000000)

Then configure this number in Date column as key-value to update the corresponding row.

57.PNG

Please take a try and see if it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

That's exactly what I need, thanks!

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (37,522)