new Date () with no time zone

1

I have to send a date javascript to my controller via FullCalendar . In my action, I'm getting a DateTime and I need to send through the javascript file with new Date(minha_variavel) .

But when I do this, it comes with the -3 hours time zone, that is, if I select 10/08/2015 00:00:00 on FullCalendar , I get the controller on the following date: 09/08/2015 21:00:00 .

Is there a way to get past the date without this happening?

    
asked by anonymous 21.08.2015 / 16:38

1 answer

2

When working with dates the best alternative is to work with momentjs

But you could use:

var d = new Date('10/08/2015 00:00:00');
d.toLocaleString() // 08/10/2015 00:00:00
d.toString(); //Thu Oct 08 2015 00:00:00 GMT-0300 (Hora oficial do Brasil)
d.toGMTString();  //Thu, 08 Oct 2015 03:00:00 GMT
d.toUTCString();  //Thu, 08 Oct 2015 03:00:00 GMT
    
24.08.2015 / 00:13