Back

DateTime object timezone

  • 1
  • Databases
  • Flutter
Mosh Ontong
28 Aug, 2023, 14:28
TypeScript
  final not = DateTime.now();
  print(not.timeZoneName);
  print(not.toIso8601String());
   print(not.toLocal().toIso8601String());

so when we actually add a value in DateTime object in apwrite we actually converting the DateTime into ISO string. In my case, my timezone is philippines, but when adding it to appwrite it converts into a UTC timezone?

TL;DR
The user is asking how to handle timezones correctly when using the DateTime object in Appwrite. The solution is to send the DateTime object to Appwrite in UTC format by using the toUTC() function instead of toLocal().
Drake
28 Aug, 2023, 15:30

You should be sending it to Appwrite in UTC. So do toUTC() instead of toLocal()

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more