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

Compare two time

(0) ShareShare
ReportReport
Posted on by 108

Hi,

 

I am struggling to compare time in power apps. I want to compare my sharepoint time with current time  using Now()  function in power apps
I have 2 options 
-datetime column with time (it restricts the time with date)
-single line of text with time (it does not allow comparison between time as operators expected a number type)

I have multiple questions to ask. 
1- Is it possible to  have  time only column in sharepoint list like in datetime type?
If not then, I set my time column as single line of text. So my next question is:
2- How can i compare a text column with the current time only (not with date)?

Need help on this would be appreciated

Thanks in advance

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Jackson_Dhorty 

    Could you use the DateDiff() function to capture the difference between a column value in SharePoint and the current time.  It could give you a number value in seconds, minutes, hours, months, quarters, or years.  The result could be used for calculations, etc._1.png

  • Jackson_Dhorty Profile Picture
    108 on at

    should it be a text column in sharepoint? or date time column? 

    my sharepoint time in text column (start > column name) in like this > 2:00 PM and i want to compare with current time in power apps using now() function

     

    can you please give me an example of that would be helpful?

    Thanks

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Jackson_Dhorty 

    Your SharePoint column would need to be converted to a time using the TimeValue() function and then the difference would be determined using DateDiff(). 

     TimeValue function converts a time string (for example, "12:15 PM") to a date/time value. See the documentation here:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-datevalue-timevalue

    I have limited experience with these conversions but @CarlosFigueira  is always my go to guy for the answers here.

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Jackson_Dhorty ,

     

    Have you resolved the issue? 

    If above post helps, then please consider Accept it as the solution to help the other members find it.


    Best regards,
    Community Support Team _ Jeffer Ni

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 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard