4

In the client js SDK, you can do the following:

import { firestore } from 'firebase/app';
const firestoreTimestamp = firestore.Timestamp.fromDate(new Date())

Is this possible with firebase node admin sdk? I tried the following:

import { firestore } from 'firebase-admin';
const firestoreTimestamp = firestore.Timestamp.fromDate(new Date())

But this give the error:

  [ts] Property 'Timestamp' does not exist on type 'typeof firestore'.
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
DauleDK
  • 3,313
  • 11
  • 55
  • 98

0 Answers0