cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

CONVERT DATE ISO 8601

Hey guys, I need to filter a gallery by date, but on the collection, the date comes like this: 

 

1582097400000 

 

 There is a possibility to convert and make a filter my gallery by date? And I need to make a default filter date + 7 days forward.

 

The name of the column:  DatadeIníciodaTarefa

 

Thanks for the help guys!

15 REPLIES 15
Highlighted
Dual Super User II
Dual Super User II

Re: CONVERT DATE ISO 8601

I believe what you have is the number expressed in Ticks.  Ticks in this case being the number of seconds after midnight on 01/01/1970.  So you can use the following formula to convert a regular date field to a similar number and use that for sorting

DateDiff(DateTimeValue("01/01/1970 00:00:00"), DateFieldToConvert, Seconds)

Or you can convert the Ticks back to a date using this formula

DateAdd(DateTimeValue("01/01/1970 00:00:00"),NumberOfTicks,Seconds)

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Super User
Super User

Re: CONVERT DATE ISO 8601

@Gorilla_8 

Please provide instructions for how to convert this number into a date.

1582097400000

 

Also let the forum know what date this number translates to?

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

Highlighted
Super User
Super User

Re: CONVERT DATE ISO 8601

Well... at least @Pstork1 understands what that crazy number means 😁

Highlighted
Post Prodigy
Post Prodigy

Re: CONVERT DATE ISO 8601

@mdevaney I don't have a clue about how to convert this number to a date 😞 

 

I need help with this...

Highlighted
Super User
Super User

Re: CONVERT DATE ISO 8601

@Gorilla_8 

...did you try the suggestion of @Pstork1?

Highlighted
Post Prodigy
Post Prodigy

Re: CONVERT DATE ISO 8601

@Pstork1 

 

Where?

Highlighted
Dual Super User II
Dual Super User II

Re: CONVERT DATE ISO 8601

First, since the number is measured in Ticks, the number of seconds after midnight on 01/01/1970. you can just sort based on that numeric field. Larger numbers are later and smaller numbers are earlier. 

 

For the range calculation. Add or subtract the number of seconds in the time period you want to use.  7 days would be 7 * 24 hours * 60 minutes * 60 seconds.  That comes to 604,800 seconds.

 

to convert back into a date use the formula I provided in my previous reply.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Post Prodigy
Post Prodigy

Re: CONVERT DATE ISO 8601

@Pstork1 Thanks for the reply!

But unfortunately, I can't find the reply post you are mentioning...

 

Sorry about that 😞

Highlighted
Dual Super User II
Dual Super User II

Re: CONVERT DATE ISO 8601

It was the first reply on this post.

 

I believe what you have is the number expressed in Ticks.  Ticks in this case being the number of seconds after midnight on 01/01/1970.  So you can use the following formula to convert a regular date field to a similar number and use that for sorting

DateDiff(DateTimeValue("01/01/1970 00:00:00"), DateFieldToConvert, Seconds)

Or you can convert the Ticks back to a date using this formula

DateAdd(DateTimeValue("01/01/1970 00:00:00"),NumberOfTicks,Seconds)

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,425)