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

HTML table - using hours format

Hi,

I have been trying to send an email using an HTML table to send a report. however, the hours appear in the wrong format, 

 

[email result]

1.png

 

inside the excel I'm using the hour format 12:00 AM

 

[Excel data]

2.png

 

Can I use some kind of code inside the HTML creation?

3.png

could you please help me?

Thank you

br,

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Hi @Kamacete how are you?

 

Following the suggestion sent by @ScottShearer I did a small modification to use a simple function to split the value, doing some calculations and formatting the result.

 

Take a look on my sample:

 

05.jpg

 

 

The formula used for the item1 was:

 

formatDateTime(string(addSeconds(addDays('1899-12-30',int(split(items('Apply_to_each')?['time1'],'.')[0])),int(string(mul(float(concat('.',split(items('Apply_to_each')?['time1'],'.')[1])), 86400))))),'HH:mm tt')

 

Please let me know if it helped to answer your question and please mark the answer.

 

Regards.

 

Rodrigo Hentz

Microsoft Support Engineer

 

View solution in original post

4 REPLIES 4
Super User III
Super User III

@Kamacete 

The issue you are experiencing is due to how Excel stores dates (number of says since 1/1/ 1900). 

Here is a link to a Blog post that may help.

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Microsoft
Microsoft

Hi @Kamacete how are you?

 

Following the suggestion sent by @ScottShearer I did a small modification to use a simple function to split the value, doing some calculations and formatting the result.

 

Take a look on my sample:

 

05.jpg

 

 

The formula used for the item1 was:

 

formatDateTime(string(addSeconds(addDays('1899-12-30',int(split(items('Apply_to_each')?['time1'],'.')[0])),int(string(mul(float(concat('.',split(items('Apply_to_each')?['time1'],'.')[1])), 86400))))),'HH:mm tt')

 

Please let me know if it helped to answer your question and please mark the answer.

 

Regards.

 

Rodrigo Hentz

Microsoft Support Engineer

 

View solution in original post

@rohentz 

Yesterday I press accept solution by mistake.

😞

my bad

 

I tried your suggestion, and this what I get:

 

a1.png

 

"formatDateTime(string(addSeconds(addDays('1899-12-30',int(split(items('Apply_to_each')?['Sites Lock'],'.')[0])),int(string(mul(float(concat('.',split(items('Apply_to_each')?['Sites Lock'],'.')[1])), 86400))))),'HH:mm tt')"

 

Can I insert for 24h, and not for 12h (AM/PM)

thank you for both

Frequent Visitor

@rohentz @ScottShearer 

 

I have a similar problem with formatDateTime functio and have tried all the above solutions, but can't seem to get it working.

 

I have raised a new post here: https://powerusers.microsoft.com/t5/Building-Flows/Format-timestamp-from-Excel-Online-to-send-mails/... 

 

Can you please guide me?

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!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

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 (50,552)