Issue 794: Wrong timestamp request JSON
Status:  Done
Owner: ----
Closed:  Jan 2011
Reported by gabou...@gmail.com, Jan 14, 2011
I'm using FullCalendar 1.4.10, JQuery 1.44
I use JSON request to get my events.

I'm checking the value of $_GET['start'] and $_GET['end']


First system : 
   Timezone : Tokyo (GMT+8)
   Localtime : 12am30
   Value of $_GET['start'] : 1293375600

Second system :
   Timezone : Paris (GMT+1)
   Localtime : 4am30
   Value of $_GET['start'] : 1293404400

Problem :
The time UTC is the same for the two system, but the timestamp value have 28800 seconds difference (8 hours)

Normaly, a timestamp is a value calculate from an UTC date. Impossible to say it's a timestamp if it's calculate from a local time.
time.png
420 KB   View   Download
Jan 15, 2011
#1 gabou...@gmail.com
My own "bug fix" or "feature fix" :


****** JS Code **********
var now = Date();
[...]
//Now, when you give the address to get the events :
events: 'http://www.youraddress.com/?offset='+(parseInt(now.getTimezoneOffset())*60),


****** Php example ******

$timestampUTC_start = $_GET['start'] -= $_GET['offset'];
$timestampUTC_end = $_GET['end'] -= $_GET['offset'];


And with this, you have the real timestamp

*******
I checked this with Chrome (GMT+8) and IE6 (GMT+1)
I don't know about the winter hour and summer hour
Jan 15, 2011
#2 gabou...@gmail.com
I'm so sorry. It was a mistake.

The timestamp is not the same... Because the beginning of the day is not at the same MOMENT if you live in Tokyo or if you live in Paris...

Sorry


Jan 17, 2011
Project Member #3 althaus.it
(No comment was entered for this change.)
Status: Done
Oct 24, 2011
#4 afilet...@gmail.com
Although this makes sense, wouldn't it be interesting to have a configuration parameter to make Fullcalendar send start/end timestamps in UTC when querying the server for events?

At this moment you have to rely on 'browser timezone offset' variables which change depending on DST for the current timezone.
May 20, 2013
#5 jfr...@gmail.com
Hello, I posted a possible solution in this discussion: https://code.google.com/p/fullcalendar/issues/detail?id=576#c3