Moment.js Parsing parseZone() Function Last Updated : 28 Apr, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report Moment.js Parsing parseZone() function parses the string provided and keeps the resulting moment in a fixed timezone. Furthermore, this method parses the string but keeps the resulting Moment object in a fixed-offset timezone with the provided offset in the string. Syntax: moment.parseZone() moment.parseZone(String) Parameters: String: The fixed-offset timezone with the provided offset Returns type: This function will return the Moment object to local or UTC time. Note: This will not work in the normal Node.js program because it requires an external moment.js library to be installed globally or in the project directory. For more details, please refer to this link. Installation of moment module: Moment.js can be installed using the following command. npm install moment Example 1: Getting the Current Parse Timezone index.js JavaScript // Importing moment module const moment = require('moment'); let a = moment().parseZone(); console.log("Current parse Timezone: ",a); Step to run the application: Run the index.js file using the below command. node index.js Output: Current parse Timezone: Moment<2022-10-08T06:55:05+00:00> Example: Parsing the timezone index.js JavaScript // Importing moment module const moment = require('moment'); let a = moment("2022-01-01T00:00:00-13:00").utcOffset("2022-01-01T00:00:00-13:00"); let b = moment.parseZone("2022-01-01T00:00:00-13:00"); console.log("Current parse Timezone: ",a) console.log("Current parse Timezone: ",b) Step to run the application: Run the index.js file using the below command. node index.js Output: Current parse Timezone: Moment<2022-01-01T00:00:00-13:00> Current parse Timezone: Moment<2022-01-01T00:00:00-13:00> References: https://momentjs.com/docs/#/parsing/parse-zone/ Comment More infoAdvertise with us Next Article Moment.js Parsing parseZone() Function G geetansh044 Follow Improve Article Tags : Web Technologies Node.js Moment.js Moment.js-Parse Similar Reads Moment.js Parsing Moment Clone In this article, we will learn how to clone and parse moment.js objects. Cloning and Parsing Moment.js Objects: All Moment.js objects are parsable and clonable. Cloning a moment could be done, both implicitly and explicitly. Installation: npm install moment  Syntax: moment(Moment); // Moment is a 1 min read Moment.js moment().unix() Function The function moment().unix() retrieves the count of seconds since the Unix Epoch, which is a reference point for denoting a specific moment in time. Unix time serves as a system for timestamping.Syntax:moment().unix();Parameters: This function has no parameters. Return Value: This function returns t 1 min read Moment.js Parsing String + Format Moment.js Parsing String+Format is used when we want to parse a date string through the given format string. The parser will ignore the non-alphanumeric characters of the format. It returns the parsed date as a Moment object. Syntax: moment(String, String, Boolean); Parameters: This method accepts t 1 min read Moment.js Parsing Creation Data Moment.js is a date library for JavaScript that parses, validates, manipulates, and formats dates. We can use the creationData() method to get information about the input, format etc of a given moment. The moment().creationData() function can be used to retrieve the creation data of a given specific 4 min read Moment.js moment().to() Function The moment().to() function is used when users want to display a moment in relation to a time other than now. This function calculates the time to a particular date in Node.js. Syntax: moment().to(Moment|String|Number|Date|Array, Boolean); Parameters: This function has two parameters, first one is o 2 min read Like