Reputation: 411
Is there a simple way to convert a Date value to the UNIX timestamp in PowerApps?
For example:
UNIX(Today()) // -> 1583722800000
//Or
UNIX(Date(2020, 03, 09)) // -> 1583722800000
Upvotes: 1
Views: 2325
Reputation: 688
Another way would be to use the ticks difference:
div(sub(ticks(utcNow()), ticks('1970-01-01')),10000000)
gives current time in seconds from 1970/01/01.
Upvotes: 0
Reputation: 411
Text(Date(2020, 03, 09), "") // -> 1583722800000
DateDiff(Date(1970, 01, 01), Date(2020, 03, 09), Milliseconds) // - Timezone Offset
// -> 1583722800000
But be careful as this case will take your timezone in account.
Upvotes: 3