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 date

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

How to get current year from predefined function or from textfield containing date . Also how to compare the date with current year? Please suggest some help.

Categories:
  • Matthieu Profile Picture
    67 on at

    Hi,

     

    you may find what you need here :

    https://powerapps.microsoft.com/en-us/tutorials/function-date-time/

    https://powerapps.microsoft.com/en-us/tutorials/show-text-dates-times/

     

    the function DateDiff can be used to compare 2 dates

     

     

  • Steelman70 Profile Picture
    873 on at

    Hi, in addtition to what MatthieuMegaly suggested you can use the string functions Left, Mid, Right.

    Example here https://powerusers.microsoft.com/t5/PowerApps-Forum/Using-numbers-and-dates-from-SharePoint-lists/m-p/2268

  • hngdev Profile Picture
    304 on at

    Hello,

     

    To get current date, you can you Now function

    To compare date:

    - I think you should convert the date text type from textfield (I assume) to date type by using Date function

    - Then, use DateDiff function to compare 2 dates.

    You can go here (Formular Reference) for more information.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    You can use for example:

     

    Text( yourDateVariable, "mm/dd/yyyy" ) = Text( Today(), "mm/dd/yyyy" )

  • Verified answer
    Bassel Profile Picture
    23 on at

    Hello , 

    I managed to compare two dates and show and hide a field if the time differenence is more than a year like this :

    If(
    DateAdd(
    TargetItem.LastReview,
    365,
    Days
    ) < Now(),
    UpdateContext({UpdateBTNgroup: true}),
    UpdateContext({UpdateBTNgroup: false})
    );

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for the useful tip @Bassel

     

    @Anonymous

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard