Moment.js Jump Start PRO

Moment.js is a simple tiny JavaScript library that assists us with parsing, formatting and manipulating date values.

Using the Moment.js JavaScript library usually involves with calling the moment() function that returns a reference for a new object that represents the current time.

The code shown in this video clip is available below. Make sure you fix the relative links to the required JavaScript file.

<!DOCTYPE html>
<html>
<head>
    <title>Moment.js Jump Start</title>
    <script type="text/javascript" src="moment.js"></script>
</head>
<body>
    <script type="text/javascript">
        document.writeln("<br/>"+moment().format('MMMM Do YYYY, h:mm:ss a'));
        document.writeln("<br/>"+moment().add('days', 1).calendar());
    </script>
</body>
</html>

You can find slides and video clips that explain how to use this library in my free courses website at http://abelski.lifemichael.com.

Share:

banner for the css playlist in hebrew life michael courses for programmers

The First Steps in CSS

Learn CSS using our our videos (in Hebrew) on the CSS (he) playlist on youtube. Do it now. Do it for free.

Good Trainers Collaborate with Others

It is always essential to keep an open mind and learn from others. This applies to everyone, including teachers and especially software development trainers. Software

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences