Date Functions in Javascript: Data functions will work depends on the system time.
getDate: it written current date.
Example:
var d=newDate();
document.write(d.getDate()+’<br>’);
getMonth: It get current month.
Example:
document.write(d.getMonth());
getDay: It written current day in week, week started from 0-6.
Example: document.write(d.getDay());
getYear: It written current year started from 1900.
Example: document.write(d.getYear));
getFullYear: It written current year with four digit formate.
Example: document.write(d.getFullYear());
getHours: It written current hour.
Example: document.write(d.getHours());
getMinutes: It written current minutes.
Example: document.write(d.getMinutes());
getSeconds: It written current seconds.
Example: document.write(d.getseconds());
getMilleSeconds: It written mille seconds.
Example: document.write(d.getMilleSeconds());
Total Time and Date:
Example: document.write(“currenttime:::”td.getDate()+”-“+(d.getMonth()+1_+”-“+d.getFullYear()+” “+d.getHours()+”:”+d.getMinutes()+”:”+d.getSeconds());

No comments:
Post a Comment