Disabling time zone adjustment when saving task in Lightbox?

I have this code snippet:

gantt.attachEvent("onAfterTaskAdd", function(id, target) { 

    var newTask = gantt.getTask(id),
        url = '../../gantty_task.php'

console.log(JSON.stringify(newTask))

    jQuery.ajax({  <call to server to save new task> ...

.....

When adding task I enter “30 January 2016” in “Task Start”. The “console.log” from above displays

… “start_date”:“2016-01-29T17:00:00.000Z”, …

Is there a way to disable time zone adjustment and simply pass the date entered in the lightbox to the server? I was not able to find a simple solution to this. There is no need to make “Task Start” time zone dependent in this application.

Hello, I am still interested in solving this. Is there a simple setting that I am overlooking? Sorry, it’s my first Gantt programming experience.

Hi,
this is how JSON.stringify serializes Dates, i.e. this is a feature of JSON.stringify, not the gantt
stackoverflow.com/questions/1486 … use-of-utc

As a solution, you can prepare the data object for sending - make a copy of gantt task and manually stringify its dates:

[code]gantt.attachEvent(“onAfterTaskAdd”, function(id, target) {

var newTask = gantt.getTask(id),
    url = '../../gantty_task.php'

var sendData = gantt.copy(newTask);
var dateToStr = gantt.date.date_to_str("%d-%m-%Y %H:%i");
sendData.start_date = dateToStr(sendData.start_date);
sendData.end_date = dateToStr(sendData.end_date);

jQuery.ajax({  <call to server to save new task using sendData object> ...[/code]

Thank you, it’s working now.