so from the documentation in here it said that
A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time
but here is my timestamp field in my document
as you can see, there is UTC+7. I am from Indonesia, and my Firestore database is also in region asia-southeast2 (Jakarta,Indonesia).
my question is .....
can I actually change that timezone ? even though the documentation says that timestamp is independent from any timezone. but I don't Understand why Firestore can get that UTC+7, which is correct because I send the data from Indonesia (UTC+7)
I try to manipulate date object in my Android app, and send data using different timezone (UTC+9), but it will always be saved as UTC+7.
so basically I am trying to find out if there is a bug in my code or timezone in firestore can't be changed
In Firestore, timezones are not encoded into timestamp values. All timestamps are measured in UTC. This is normal for dates and times for all major operating system. What you see in the console is the timestamp value formatted for the timezone that your local computer is currently configured for. If you want to see a different timezone there, you would have to change your computer's configured timezone. Change the timestamp value itself won't really help.
Your code should only create and manipulate timestamp values that are also measured in UTC. If you are somehow receive data formatted form another timezone, you should convert it to UTC first before creating a timestamp.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With