cancel
Showing results for 
Search instead for 
Did you mean: 

Relative dates in PowerApps

I would love to have a way to compare a date to the current time and get a relative time like MomentJS. Like for instance: 

 

RelativeDateTime(CreatedDateFromDataSource, Now())

should become 

 

4 hours ago / 2 days ago

or

 

yesterday

For more specifics about what I mean, take a look at the Moment.js website: link.

Status: New
Comments
WPB
Level 8

You can use:

In a timer : 
AutoStart = True
AutoReset = True
OnTimerEnd = UpdateContext({Now:Now()})
Duration: 1000

In a textbox:
DateDiff(StartDate,Now,Days)

Note: You can format it using text:
Text(Time(0, 0, DateDiff(StartDate,Now,Seconds)), "[$-en-US]dd hh:mm:ss")