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 Format

(1) ShareShare
ReportReport
Posted on by 411

Hello community!

 

Is there a way to format a date in PowerApps where my date is 4/21/2023 10:19 AM to be changed for example 1 min ago then 4 hours ago then 1 day ago and like that. 

 

The date value is ThisItem.Created from the Default created column in SharePoint.

 

Thanks. 

Categories:
I have the same question (0)
  • Verified answer
    NZ0090 Profile Picture
    317 on at

    Hi @HectorOlivos !

     

    I guess you can do something like this?

     

    If(
     DateDiff(ThisItem.Created, Now(), TimeUnit.Minutes)<60, 
     DateDiff(ThisItem.Created, Now(), TimeUnit.Minutes) & " minutes ago",
    
     DateDiff(ThisItem.Created, Now(), TimeUnit.Minutes)>60 && DateDiff(ThisItem.Created, Now(), TimeUnit.Hours)<24, 
     DateDiff(ThisItem.Created, Now(), TimeUnit.Hours) & " hours ago",
    
     DateDiff(ThisItem.Created, Now(), TimeUnit.Days) & " days ago"
    )

     

     

  • HectorOlivos Profile Picture
    411 on at

    Yep that worked, though i found another solution: 

     

    If(
     DateDiff(
     (ThisItem.Created),
     Now(),
     TimeUnit.Minutes
     ) < 60,
     Concatenate(
     Text(
     DateDiff(
     (ThisItem.Created),
     Now(),
     TimeUnit.Minutes
     )
     ),
     " mins ago"
     ),
     DateDiff(
     (ThisItem.Created),
     Now(),
     TimeUnit.Hours
     ) <= 24,
     Concatenate(
     Text(
     DateDiff(
     (ThisItem.Created),
     Now(),
     TimeUnit.Hours
     )
     ),
     " hours ago"
     ),
     DateDiff(
     (ThisItem.Created),
     Now(),
     TimeUnit.Days
     ) <= 31,
     Concatenate(
     Text(
     DateDiff(
     (ThisItem.Created),
     Now(),
     TimeUnit.Days
     )
     ),
     " days ago"
     ),
     DateDiff(
     (ThisItem.Created),
     Now(),
     TimeUnit.Months
     ) <= 12,
     Concatenate(
     Text(
     DateDiff(
     (ThisItem.Created),
     Now(),
     TimeUnit.Months
     )
     ),
     " months ago"
     ),
     Concatenate(
     Text(
     DateDiff(
     (ThisItem.Created),
     Now(),
     TimeUnit.Years
     )
     ),
     " years ago"
     )
    )

     

    Thanks for the answer! 

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 426

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard