GoConqr has a new look! Let us know what you think.

Flowchart

The Date Object

Kostas Diakogiannis Web Developing Junior Certificate English

Flowchart content

  1. JavaScript Date Object

  2. The Date Object

    The Date object is a native object that is being provided to us by JavaScript in order to perform any operations that deal with dates. Booking applications for hotels, flights or events deal with the date object to provide their exmperience/

    In order to start working with dates you need to create a new date object. This is done by the date constructor.

    let today = new Date(); //Beware if no parameters are passed to the constructor then the date is the exact date of now, the date that the script executed itself and especially this line.

    You can also pass a specified date by passing either arguments inside the Date constructor or a string. For all the possible ways to create a new date please reference the links below:

    Create date object possible methods.

    Create date objects by passing a human readable string.

    In order to access information from a date object you must use one of the native date 'getter' methods like:

    console.log(today.getFullYear()) // this returns 2018 as a number.

    See all getter functions for retrieving information from a date object here!

    In order to change a specific part of a date object we use a list of functions that are provided to us, the so called 'setter' date functions.

    let todayNextMonth = new Date();

    todayNextMonth.setMonth(today.getMonth() + 1); // this will set the month onto the next month from today. Today is 15th October, this will set the date to 15th Nov 2018.

    Check full docs for setter functions and how to change specific piece of info here!

    c

    /

Information

Description
Junior Certificate Web Developing Flowchart on The Date Object, created by Kostas Diakogiannis on 15/10/2018.
Views
2
History
  • Created by Kostas Diakogiannis · Oct 12, 2018
  • Copied by Kostas Diakogiannis · Oct 12, 2018
  • Copied by Kostas Diakogiannis · Oct 12, 2018
  • Copied by Kostas Diakogiannis · Oct 15, 2018
  • Copied by Kostas Diakogiannis · Oct 15, 2018
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?