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 Apps
Answered

Date/Time Add

(0) ShareShare
ReportReport
Posted on by 353

Hello,

 

I am trying to figure out how to take a date/time item and add time to it. My Date/Time column from my SQL Table has the following format: 2019-10-22 21:52:43.000. In Power Apps it grabs it as 10/22/2019 9:52 PM

 

I would like to grab it as the way my SQL Table has it (same format) and be able to add 45 seconds to it.

 

Thank you

Categories:
I have the same question (0)
  • RusselThomas Profile Picture
    4,014 on at

    Hi @mmattar ,

    Check out the DateAdd() function;

    DateAdd(yourdate, 45, Seconds)

    Also check out the Text() and DateTimeValue() functions for changing the display format.

    Hope this helps,

    RT

  • mmattar Profile Picture
    353 on at

    Hey i applied some of what you said and i got this far:

     

    10/22/2019 9:52 PM is what i am getting from Power Apps, "Parent.Default", i apply this Text and DateTimeValue function on it Text(DateTimeValue(Parent.Default),DateTimeFormat.LongTime24) and get 21:52:00, but it is suppose to be 21:52:43. Why is it not counting the seconds, how can i grab those as well. 

     

    Thanks

  • Verified answer
    RusselThomas Profile Picture
    4,014 on at

    Hi @mmattar ,

    Is your SQL column a date formatted as text, or an actual datetime?

    When rendering dates, it helps to understand the source type vs the display type.  It sometimes gets tricky using Text() to render datetimes as it has a source type of DATETIME but will result in a TEXT type output. 

    In your formula, you're converting Parent.Default to DateTimeValue - the DateTimeValue function expects a text input.

    Text(DateTimeValue(Parent.Default),DateTimeFormat.LongTime24)

    So, is parent.default actually a string?

    The reason it's important is that a source type of DATETIME can be rendered in many ways, but the data will always be the full datetime down to the millisecond.  You might only display the year, month, day or hours and minutes, but you can change your mind and display it down to the millisecond if you like because all the data is there.

    When rendering off a TEXT type (a date formatted as text), then the only information available is what has already been rendered in text.  If the text only shows year/month/day then the rest will default to 00:00:00

    In your case, I would expect the SQL data to be an actual DATETIME value, in which case you should be able to just do this;

    Text(Parent.Default,"yyy-mm-dd hh:mm:ss")

     If it's actually a text type, and it has the seconds as you indicated in your original post, then this should work;

    Text(DateTimeValue(Parent.Default),"yyy-mm-dd hh:mm:ss")

    Included an example screenshot below - see the last one is a text conversion from the date you originally posted;

     

    datetime.png

    Hope this helps,

    RT

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
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard