FullCalendar 1 hour more

I am using the jQuery plugin to render the calendar ( http://arshaw.com/fullcalendar/ ). The problem is that the dates are one hour ahead. I tried to browse the files to find out where this is happening.

Could there be something with daily savings? I am pretty ignorant. The dates from the database are correct, but after they are converted to a UNIX timestamp, they skip one hour.

I use this to convert a date to a timestamp.

private double ConvertToTimestamp(DateTime value)
{
    //create Timespan by subtracting the value provided from
    //the Unix Epoch
    var date = new DateTime(1970, 1, 1, 0, 0, 0, 0);

    TimeSpan span = (value - date.ToLocalTime());

    //return the total seconds (which is a UNIX timestamp)
    return (double)span.TotalSeconds;
}

But I believe that this is not where the problems lie.

Thank.

+3
source share
3 answers

, , ? , . . ?

+1

, :

function _changeToLocal (localDate) {
      return new Date( localDate.getFullYear(), localDate.getMonth(), localDate.getDate(), 
         localDate.getHours(), localDate.getMinutes() + localDate.getTimezoneOffset());
}

TimeZone .

+1

dev- Amazon EC2 ... Amazon , (, ).

, (Network Instance ..), .

0

Source: https://habr.com/ru/post/1762252/


All Articles