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
Unanswered

Time weirdness

(0) ShareShare
ReportReport
Posted on by 13

Greetings. For some reason, after inserting an item into an SQL table, the time displayed in PowerApps adopts a weird format. For example, if I try to insert a row with a time value equal to 08:16 and try to display it back, it shows as PT8H16M.

Categories:
I have the same question (0)
  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @jmarc ,

     

    As far as I remember, this format is used as some sort of standard. I've seen it in Power Automate for example.

     

    Can you try formatting back to normal with "Text()"?

     

    Text(time, "hh:mm")

     

  • jmarc Profile Picture
    13 on at

    Hello. I've tried formatting it the way you suggested, but it still shows as PT8H16M.

  • WiZey Profile Picture
    3,023 Moderator on at

    How is it stored in your table? Does the SQL table shows "PT8H16M" or "08:16"? 

     

    How do you add the time in your SQL table? Are you using "Patch()" and "Now()" or something else?

  • jmarc Profile Picture
    13 on at

    jmarc_0-1678806527314.png

    It shows like this (the image I added). It's a SQL column with time datatype.

    I'm using a text input as a control. Its default value is set to:

    Text(Now();"hh:mm")

    To add it, I'm using a patch function with the form:

    Patch(TableName; Defaults(TableName); {
    ...
    txtTime.Text;
    ...
    });;
  • WiZey Profile Picture
    3,023 Moderator on at

    I found this article, and that pretty much describes your situation.

     

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

     

    Basically, Power Apps uses a datetime format for its data. Because your SQL table uses a time-only column, Power Apps fails to correctly translates it.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 491

#2
WarrenBelz Profile Picture

WarrenBelz 407 Most Valuable Professional

#3
11manish Profile Picture

11manish 331

Last 30 days Overall leaderboard