Jump to content

Convert Squarespace timestamps to real date / time?

Recommended Posts

I'm trying to make some customizations to the events page, but the timestamps Squarespace provides are somehow strange: 

so e.g. this is

startDate: 1657643425538

If I do 
 

var date1 = new Date(1657643425538).toString()

startDate.toString(date1) // Tue Jul 12 2022 19:30:25 

 

But the correct date set for the event is Friday 23, 2002, 9 AM.

 

So what am I doing wrong? or what would be the best way to transform timestamp into correct date / time?

 

image.thumb.png.20f1b166dea51e0ade58f6495fbfa4e8.png 

Link to comment

Can you provide a few details about your ultimate goal? What are you trying to change about the Events page?

Also, it is always helpful if you can provide a public link to the page you are working on so that we can see what you're seeing. 

About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!
If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.
Improve your online store with our extensions.

Link to comment
  • 10 months later...

I think timezone has been taken into account, so you have to assign correct timezone to the date value

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.