How to create Date Object in JavaScript - JavaScript Tutorial 83

preview_player
Показать описание
Notes for You:: How to create Date Object in JavaScript - JavaScript Tutorial 83
- We create date objects using Date constructor function.

Syntax:
var dateObjectName = new Date() ;
- Creates a date object using the system current date & time.

var dateObjectName = new Date(date:String) ;
- Creates a date object using the given date string.

var dateObjectName = new Date(year, month, date[, hours[, minutes[,seconds[,ms]]]])
- Creates a date object using given parameters.

var dateObjectName = new Date(value:int) ;
- Creates a date object using given integer value, representing time in milliseconds.

Note:
- Date object stores date & time based on the numbers of milliseconds elapsed from Thu, 01 Jan 1970 00:00:00 GMT.

Example Code: 1. Creating date objects in different ways:
var date1 = new Date();

var date2 = new Date("Sun Mar 25 2018 23:37:09");

var date3 = new Date(2018,2,25,23,37,09);

var date4 = new Date(2*24*60*60*1000);

=========================================

Follow the link for next video:
JavaScript Tutorial 84 - How to Display Dates in different formats in JavaScript

Follow the link for previous video:
JavaScript Tutorial 82 - Date object in JavaScript | JavaScript Date Object

=========================================

JavaScript Tutorials Playlist:-

=========================================
Watch My Other Useful Tutorials:-

jQuery Tutorials Playlist:-

jQuery UI Tutorials Playlist:-

Bootstrap Tutorials Playlist:-

=========================================

► Subscribe to our YouTube channel:

► Visit our Website:

=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
Рекомендации по теме
Комментарии
Автор

SUBSCRIBE, SHARE & SUPPORT:
VISIT & LEARN AT FREE OF COST:

ChidresTechTutorials
Автор

Can u refer some books sir for beginners?

I am waiting for your notes for a very long time😁

prabu