web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Capture time stamp wit...
Power Apps
Answered

Capture time stamp with seconds

(0) ShareShare
ReportReport
Posted on by 12

Hello,

 

I am having difficulties obtaining a time stamp with the following attributes:

[$-en-US]mm/dd/yyyy hh:mm:ss

Example: 2/19/2020 15:49:55

 

I want the time stamp to read out to the second in my Excel data source. Here is the OnSuccess formula I am using currently:

Patch(
       Table2,
       CheckOutForm.LastSubmit,
       {'Time Stamp': Value(Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss"), 'In or Out': Text("Out")}
)

 

Any help would be greatly appreciated!

Categories:
  • LeifGoleman Profile Picture
    12 on at

    I wanted to attach a screenshot of my output

    Excel Output.jpg
  • Erica0214 Profile Picture
    on at

    Hi LeifGoleman,

     

    If you want to read the current date/time to seconds, please have a try of this function Text( CurrentTime, LongTime24 ) replacing Value(Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss"). 

     

    This will show the current time, down to the second. 

     

    Thank you for using Microsoft Dynamics 365 Communities,

    Erica Bao
    Support Engineer

    Microsoft Dynamics 365

     

     
     
     
  • Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    Hi @LeifGoleman,

    Adding to @EricaBao, the Value() function turns Now() into a number. Text() is the equivalent of the same function in Excel that would allow you to format Now() in the way that you would like.

  • LeifGoleman Profile Picture
    12 on at

    @EricaBao,

    It is not allowing me to use the Text function, that is why I am using Value() instead. Is this because I need to format the column differently in the data source? My apologies, as I am very new to PowerApps.

    Thanks,

    2020-02-20_9-29-51.jpg
  • Verified answer
    Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    @LeifGoleman ,

    This is a limitation of the Excel connector itself. If you want to write datetimes such as Now(), it will save up to the minute and the data type will be a datetime.

     

    If you change your mind and decide you want to save a formatted date time instead, that data type would be a string and not a date time. You are using the Text() function after all and it is a transformation of the data and not just a cosmetic change.

     

    Because Excel does not restrict columns to one data type, changing a column type to accept multiple data types can lead to unwanted behaviors so I would discourage you from mixing text strings and datetimes. Spreadsheets are free-form unlike databases which require strict types.

     

    So the error you are likely getting is that the data you are trying to write is not what the table is expecting. (In the future, please copy paste the error you are seeing.)

     

    My suggestion with using Excel as a datasource is that it is ideal for prototyping, but not something you should use in production because it does not strictly type data.

  • LeifGoleman Profile Picture
    12 on at

    @Mr-Dang-MSFT,

    This is exactly what I was looking for. I am in the prototype stage, but we will be changing to SQL very soon, which should fix the problem. Thank you for your help in understanding this issue!

  • Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    I will add that if SQL is your preferred data source, I would suggest using a column of type DATETIMEOFFSET with Power Apps.

     

    Here's a blog by @CarlosFigueira that describes datetimes in greater detail:

    https://powerapps.microsoft.com/blog/working-with-datetime-values-in-sql/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard