Creating Date Object
Date Object is used with days and hours. We create it by using the Date () constructor.
We have 4 ways to create a Date Object
Note:
All parameters Optional so we can put the number of parameters that we want.
data String may include:
Thu Sep 11 2008Thursday, September 11, 2008Thursday, September 11, 2008 5:24:39 PM5:24:39 PM
example
Date Method
getDate (): Return day from(1 to 30)
getDay ():Return weeks from (0 to 6)
getFullYear (): Return year with 4 digits
getMonth (): Return month from (0 (January) to 11 (December))
getHours (): Return hour from (0 to 11)
getMinutes (): Return minutes from (from 0 to 59)
getSecondes ():Return seconds in 1 minutes (0 to 59)
getTime (): the number of seconds from 1 January 1970 0 our arrival Date Object
example
Thu Jan 05 2012 11:42:53 GMT+0700 (SE Asia Standard Time)Date: 5Day: 4Year: 2012Month: 0Hour: 11Minute: 42Second: 53






0 comments:
Post a Comment