cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gorilla_8
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
Pstork1
Dual Super User III
Dual Super User III

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.
mdevaney
Super User III
Super User III

@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." 

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

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

 

I need help with this...

@Gorilla_8 

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

@Pstork1 

 

Where?

Pstork1
Dual Super User III
Dual Super User III

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.

@Pstork1 Thanks for the reply!

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

 

Sorry about that 😞

Pstork1
Dual Super User III
Dual Super User III

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (40,518)