firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

firebase/database `serverTimestamp()` returns future time

Open mmyoji opened this issue 1 month ago • 3 comments

Operating System

Windows 11

Environment (if applicable)

Chrome 142

Firebase SDK Version

12.4.0

Firebase SDK Product(s)

Database

Project Tooling

Vue app w/ Vite

Detailed Problem Description

We have two projects (dev/prd)

and serverTimestamp() records:

  • correct time in dev project
  • INCORRECT time in prd project (about 1 minute ahead)

.info/serverTimeOffset returns:

  • small value in dev project
  • large value (over 70000) in prd project

Is there a way to fix this large time offset? or shouldn't I trust firebase server timestamp?

Steps and code to reproduce issue

https://gist.github.com/mmyoji/9475c30446cf5779bd9fae1a5f2eb5a0

mmyoji avatar Nov 10 '25 04:11 mmyoji

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Nov 10 '25 04:11 google-oss-bot

Since the difference is between two projects, I don't think we could reproduce or examine the problem without looking at the exact projects involved. Obviously you wouldn't want to share the project details here publicly. If you contact Firebase Support (https://firebase.google.com/support) they may be able to look at your exact projects and try to figure out what the difference is between them.

hsubox76 avatar Nov 13 '25 03:11 hsubox76

Firebase Support said that they didn't have the permission to our projects and they had no idea. We've given up using the serverTimestamp() and manage it by ourselves.

mmyoji avatar Nov 17 '25 02:11 mmyoji