1

I am looking to implement the following: Calendar example

What I am looking to do is wipe out all the events and start fresh with my own event dates. There are many locations where I see date occurance,

One of the event entry is the following from events.json:

{
    "date": "1337594400000",
    "type": "HERE I AM",
    "title": "Project A meeting",
    "description": "Lorem Ipsum dolor set",
    "url": "http://www.event1.com/"
},

How is the date calculated with: 1337594400000?

I looked at the documentation but wasn't too clear. If someone good with json could give me some ideas or how should I go on about starting it, I would greatly appreciate it.

3
  • 1
    Just make a date object with the number (milliseconds since the epoch). Date(1337594400000) yields a date object equivalent to "Mon Apr 22 2013 14:50:44 GMT-0500 (CDT)" -- developer.mozilla.org/en-US/docs/JavaScript/Reference/… Commented Apr 22, 2013 at 19:52
  • Definitely got a better understanding of time/date. How do I start fresh so I set the date and time and events? Commented Apr 22, 2013 at 20:12
  • What I am trying to understand is how does events.json interact with event.humanDate.json.php to display the events. I added a new date event in the second file but do not see it reflect on the calendar. In events.json there is a entry: { "date": "1334656800000", "type": "meeting", "title": "Test Project C Brainstorming", "description": "Lorem Ipsum dolor set", "url": "event7.com" } and the 1334656800000 equals to Tue, 04 Aug 44263 16:00:00 GMT but there is no entry in the calendar for August. Commented Apr 22, 2013 at 20:33

1 Answer 1

3

It is the unix time with milliseconds.

Take your value 1337594400000, then remove miliseconds 1337594400 and convert with this site for example : http://www.onlineconversion.com/unix_time.htm => Mon, 21 May 2012 10:00:00 GMT

You can obtain the unix time with milliseconds using gettime() function of a JS date http://www.w3schools.com/jsref/jsref_gettime.asp

or echo (date('U')*1000) in PHP for exemple.

Sign up to request clarification or add additional context in comments.

1 Comment

Definitely got a better understanding of time/date. How do I start fresh so I set the date and time and events?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.