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

287
Views
How to update Firestore Timestamp to a future value

We have a check-in and check-out component in our web app that simply uses firebase timestamps. However, we need the ability to edit those timestamps in the event someone makes a mistake.

checkInTimeStamp: fb.firestore.FieldValue.serverTimestamp("17:00") simply returns the current time.

Instead of 17:00, what object do we need to pass through the function to get the correct timestamp?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The serverTimestamp() generates current timestamp on server side. You can use a Date object instead to store a future date:

const futureDate = new Date();

// update date to future time
futureDate.setDate(futureDate.getDate() + 5);

db.document('col/doc').set({ checkInTimeStamp: futureDate })

Checkout other method like setDate() in MDN docs.

about 4 years ago · Juan Pablo Isaza Report
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!