#Create Date UTC

5 messages · Page 1 of 1 (latest)

primal elbow
#
const dateStr = "2022-02-23"
const date = new Date(dateStr);
const day = date.getUTCDay();
const month = date.getUTCMonth();
const year = date.getUTCFullYear();
console.log(Date.UTC(year, month, day));

needs Date.toUTC in timestamp or date obj for firestore to store as timestamp. How do it do that whilst in utc format. Ty

gaunt mesa
#

if you want a timestamp, just use getTime

#

@primal elbow