Write about date object in Java Script


date object:

 java script includes a well defined date class which provides functions to perform many different date manipulations.

   In java script date and times represents the number of milli seconds since 1st January,1970 UTC. Java script represent time in UTC and local notations.
UTC is Universal time, Local time is the time on the machine In which the script is executing. A java script date object can represents date from -100,000,000 to +100,000,000 days relative to 01/01/1970.

Java script date functions:

To illustrate date functions define a variable vardt= new date();

Method
Description
Example
date()
Returns the current and time
vardt=date();
get Date()
Returns date between the days of 1 & 31
dt.getDate();
get Day()
Returns the day of the week, numbered 0 to 6
dt.getDay();
get FullYear()
Returns the year as a four digit number
dt.getFullYear();
getYear()
Returns the year as a 2 digit number
dt.getYear();
getHours()
Returns the current hour from 0 to 23
dt.getHour();
getMinutes()
Returns the current minutes from 0 to 59
dt.getMinutes();
getSeconds()
Returns the current seconds from 0 to 59
dt.getSeconds();
getMilliseconds()
Returns the current milliseconds from 0 to 999
dt.getMilliseconds();
getTime()
Returns the milliseconds since January 1,1970
dt.getTime();
setDate()
Specifies the day of the month
From 1 to 31
dt.setDate(3);
setMonth()
Specifies the month from 0 to 11
dt.setMonth(4);
setHours()
Specifies the hour of a day
dt.setHour(5);
setSeconds()
Specifies the seconds of the date object
dt.setSeconds(6);
getUTCDay()
Returns the day of the week, according to universal time (from 0-6)
dt.getUTCDay();
Returns the year, according to universal time
Returns the hour, according to universal time (from 0-23)
Returns the milliseconds, according to universal time (from 0-999)
Returns the minutes, according to universal time (from 0-59)
Returns the month, according to universal time (from 0-11)


Related

Explain properties and values in style.

A number of properties of text can be altered. The best way of discovering how styles work. Is to play around with some of there properties. 1. Fonts 2. Background & colors 3....

Write about HTML Frames

The output screen of every html application is nothing but a ‘frame’. The region of browser can be divided into  multiple regions hence. We can refer to them as multiple frames. ...

Explain about Style Sheets? (or) Explain how Styles are applied to a HTML Document?

Cascading Style Sheets: It provides an approach to define and associate rules for html page. In html program we can use tags to design content in the web page. We can use attributes...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item