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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -