Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's firebase / firestore timezone

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?

like image 407
Dodo Avatar asked Aug 31 '25 22:08

Dodo


1 Answers

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.

like image 60
Gastón Saillén Avatar answered Sep 03 '25 12:09

Gastón Saillén