0

The difference is pretty huge, nearly 5 hours and 30 min.

Event in UI The data in the database is : enter image description here

Day Event Format in UI

What is the possible reason and solutions to get this synced up.

Fullcalendar

I have tried with different timezones, like local, IST. Nothing seems to work.

dead_webdev
  • 164
  • 2
  • 9
  • 2
    What timezone are you in? Perhaps the database has UTC values? – phuzi Dec 23 '20 at 15:46
  • 2
    3:30 pm to 9:00 pm is exactly 5 1/2 hours not "nearly 6 1/2 hours" – phuzi Dec 23 '20 at 15:48
  • Agree, sounds like a timezone conversion – ADyson Dec 23 '20 at 16:54
  • @phuzi i am in IST time zone. The format is same as what i have given for date time picker, have not done anything specific in database. Can i set specific timezone in datepicker as well as in fullcalendar to fix this. – dead_webdev Dec 24 '20 at 06:38
  • @phuzi updated the description – dead_webdev Dec 24 '20 at 06:47
  • 1
    Without a timezone the browser assumes the date is UTC and adjusts date and time portions to match the browser's local time zone - this is why you are seeing a change. Ideally this is exactly what should happen and you'll need to implement something that stores the dates with the correct UTC time. If I were to look at the same calendar I would want it to display 21:00 to 22:00 as I am in the UK and that would represent the same time to us both. – phuzi Dec 24 '20 at 08:54
  • Does this answer your question? [fullcalendar confusion with UTC and local date](https://stackoverflow.com/questions/36500776/fullcalendar-confusion-with-utc-and-local-date) – Heretic Monkey Dec 30 '20 at 22:33
  • 1
    1) code is text. Don't include pictures of code, especially where the text isn't even visible properly at the edges. Just copy and paste it! 2) it's unclear what your datepicker has to do with this? Why did you include that, specifically? 3) can we see some of your JSON event data containing these dates please. 4) please make sure you have read the timezone article in the fullCalendar documentation for your fullCalendar version. – ADyson Dec 30 '20 at 23:43

1 Answers1

0

I had the same problem with ASP.NET Core. I solved it by setting timeZone: 'UTC' hope it works for you.

Xavi Barri
  • 11
  • 1