Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
Firebase Firestore stores wrong timestamp on server but correct timestamp in emulator

Am looking for the solution for this issue from long time, failed to figure out what is actually causing this. Am doing a project where some modules depends on various datetime calculations, user enters the date and time in a csv file like this. date and time in csv file

am reading that file and format the date and time using momenttz library, below is the code.

 const getTimestamp = (time_array,date_object) => {
    let year = date_object.substr(0,4);
    let month = (parseInt(date_object.substr(4,2)) -1);
    let date = date_object.substr(6,2);

    let hour = parseInt(time_array[0]);
    let minute = parseInt(time_array[1]);
    let second = parseInt(time_array[2]);
    console.log("hr ",hour, " minutes ", minute, " second ", second);

    let momentTime = moment.utc({ years:year, months:month, date:date, hours:hour, minutes:minute, seconds:second});
    console.log("momentTime",momentTime); // this log shows correct date and time as mentioned in csv (Moment<2021-09-21T13:25:00Z>)
     const firestore = admin.firestore;
    return firestore.Timestamp.fromDate(momentTime.valueOf());
}

then passing this to firebase add/update query. this is working fine in local emulator, showing correct date and time. for example if i pass 13:25:00 it storing same in local firestore emulator.

But on firestore console saves wrong time(18:55:00 UTC +5:30) 5hrs 30min more than what i provided. firestore console

even i changed the system time zone to Clint's time zone(Tokyo zone) to check if it is due to time zone, but still it is 9.5 hours more than client's time.

Note: i know firestore don't care about the time zone and it stores timestamp in epoch format. How can i resolve this issue?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!