How to read current time in Cloud function -
i using moment-timezone package read current time day of week. here code
var moment = require('moment-timezone'); day_of_week = moment(req_date).tz("america/los_angeles").isoweekday(); console.log("day of week " + day_of_week);
isoweekday should return monday 1 , sunday 7.
on local development environment, works well.
when code gets deployed on google cloud function, day_of_week monday returns day '7'.
any ideas?
what correct way read current time on google cloud function?
Comments
Post a Comment