Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //When creating an object
- const timestamp = new Date();
- const createdAt = timestamp;
- const updatedAt = timestamp;
- //The date is stored as follows:
- createdAt: October 23,2018 at 12:30:23 AM UTC+5:30
- //when fetched, the date is received as follows:
- e{nanoseconds: 365000000, seconds: 1539876053}
- //To manipulate date,do the following when fetching
- createdAt = createdAt.toDate()
- //to update the date after fetching
- createdAt = new Date(createdAt)
- //Then the date is stored as mentioned above.
Add Comment
Please, Sign In to add comment