ticktick-wrapper
ticktick-wrapper copied to clipboard
Shows incorrect date
This is date I have choosen.
and this is date it shows from the api

Hi!
This is the correct date stored in TickTick's servers.
I'm guessing you live somewhere on a GMT+6 timezone, and when TickTick creates the due date on your browser, it uses the the date on 12AM on local time, and then converts it to UTC.
This also happened with me, I recently moved from Brazil (GMT-3) to Vancouver (GMT-8) and all of my tasks were suddenly due one day earlier on the browser, because now it was interpreting all those tasks created in the wrong timezone.
Ahh, thank you for your reply. Got it. Any idea how to fix this? Or do I have to add +6 manually
I'd recommend that you add a date library on your project which will read the dates interpreting them as UTC and convert them to your local timeozne.
Example using an outdated library:
let utcTime = "2015-09-13 03:39:27";
let date = moment.utc(utcTime).format('YYYY-MM-DD HH:mm:ss');
console.log(date); // 2015-09-13 03:39:27
let stillUtc = moment.utc(date).toDate();
let local = moment(stillUtc).local().format('YYYY-MM-DD HH:mm:ss');
console.log(local); // 2015-09-13 09:39:27
Thank you for your suggestion and god bless your project, I used it in my discord bot project here. I'm a beginner, so my code is very messy needs to a lot of refractoring. I learned a lot from your project. Thank you