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

160
Views
How can I serverTimeStamp to Date?
try {
  const docRef = await addDoc(collection(db, "question"), {
    title: writingTitle,
    createdAt: serverTimestamp(),
  });

If you write servertimestamp() when you write, the console window says {seconds=123123123, nanosecond=!@!@}} like this. How can I change this to Date on the web?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

To convert a Firestore timestamp to a date, call toDate() on it after reading the value from the database. For more on this, see the reference docs.

There is no way to get the value before that/without reading it, as serverTimestamp() only generates a token value/sentinel that the database server recognizes as a signal to write the date/time.

about 4 years ago · Santiago Trujillo 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!