This article explains date and time manipulation based on the JavaScript library moment.js.
Working with date and time is always a bit cumbersome and implementing it using JavaScript is a bit tedious. Then we got information about moment.js. It's a very good library for validating and parsing the date and time. It also has a feature to manipulate dates based on your local time, you can parse the date in UTC format also. You can get details about moment.js using http://momentjs.com/docs/.
I will create here a sample MVC web project and implement a moment.js. Please use the following procedure.
Create a new Controller (SampleMomentController.cs) and a sample view Index.cshtml. The following is the sample code of Index.cshtml. I have used some methods of moment.js that I will explain later. Now the working environment is set for the magic of moment.js. I will explain here some methods that I have used. You can get the details from the moment.jsdocs that I have said before.
Voice of a Developer: JavaScript From Scratch