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

Format of result of Now() when patching to Excel

Hi,

 

I am patching a date from an app to an Excel file using the Now() function. The patch is working fine but the date is appearing in Excel in the format: 2021-08-13T13:58:59.730Z.

 

I want it to be in the format: dd/mm/yyyy hh:mm. 

 

Is there a way that I can make the Now() function patch in a particular date format?

 

I can get it to patch as a text string to Excel in the format required but then it's in the wrong format for using in charts etc. It also doesn't match the historical data in the Excel file that I am adding to with the app.

 

Thanks,

Izzy.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

If you need the decimal day equivalent for Excel, try:

DateDiff(DateTimeValue("1/1/1900")-2,Today(),Days)+(DateDiff(Today(),Now(),Minutes)/1440)

 

This gives a result of about 44421.4 for my current local time of nearly 9AM on August 13, 2021.

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
BCLS776
Super User
Super User

Try:

Text(Now(), "dd/mm/yyyy hh:mm")

 

Keep in mind, Excel can work with dates in frustating ways... they don't always turn out the way you want. You may have to try other options.

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Hi,

 

I need it as a number value, not as a text string. If I use the text function, then Excel doesn't register it as a date. I can convert it within Excel but then it doesn't match the existing data and messes up the charts in Power BI.

 

Izzy.

 

Izzy.

If you need the decimal day equivalent for Excel, try:

DateDiff(DateTimeValue("1/1/1900")-2,Today(),Days)+(DateDiff(Today(),Now(),Minutes)/1440)

 

This gives a result of about 44421.4 for my current local time of nearly 9AM on August 13, 2021.

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

Hi,

 

Perfect, thanks. That did exactly what I needed. 

 

Izzy.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,314)