Q1. May I know what's the timezone that firebase server and web console is?
Q2. Using FieldValue.serverTimestamp() to save data, how could I convert the timestamp to user timezone?
Q3. Could I configure timezone for firebase server?
Q4. While refer to firebase web console usage info, what's the timezone it showing? What is the latency for latest usage to appear on web console usage section?
The timezone of Firestore Timestamp is in UTC, if you want to convert that timezone to the timezone your client has do this.
You can set the timezone with DateFormat()
and parse the timestamps result with that timezone.
Date date = new Date(timestamp);
DateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
utcFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
Log.d("Date:",""+utcFormat.format(date));
Regarding Q3, I think since it's from a server-side perspective, you can't change it.
About Q4, I don't really know the latency.
Edit: I have found some info about Q3
https://firebase.google.com/docs/functions/schedule-functions
If you are doing Functions, you can setup the timezone.
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