vRO Environment for NodeJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = (context, inputs, callback) => { | |
//-------------------Don't edit above it------------------------// | |
const moment = require('moment'); // **IMPORTANT** | |
const tz = require('moment-timezone'); // **IMPORTANT** | |
const indianTimeZone = process.env.TIMEZONE_IN; // import Env variable in Node.js | |
console.log(moment().format('MMMM Do YYYY, h:mm:ss a')); | |
console.log(moment().format('dddd')); | |
console.log(moment().format("MMM Do YY")); | |
console.log(moment().format('YYYY [escaped] YYYY')); | |
console.log(moment().format()); | |
var jul = moment("2022-07-20T12:00:00Z"); | |
var dec = moment("2022-12-20T12:00:00Z"); | |
console.log(jul.tz('America/Los_Angeles').format('ha z')); // 5am PDT | |
console.log(dec.tz(indianTimeZone).format('ha z')); // 4am PST | |
//-------------------Don't edit below it------------------------// | |
callback(undefined, { | |
status: "done" | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment