Jump to content

Using the Date object.

- - - - -

  • Please log in to reply
No replies to this topic

#1
toxifyshadow

toxifyshadow

    Programmer

  • Members
  • PipPipPipPip
  • 125 posts
Here is a simple yet usefull tutorial on the Date object

If you are going to use the Date object you will need to define a variable and new Date

var dt=new Date

the you will use this to set what you want. Such as minutes,seconds,year,month,hour

dt.getMinute

//or

dt.getMonth

That is basically what you do.
You can use the
dt.getBlank
with the following, just replace Blank:
Seconds
Minutes
Hours
Month
FullYear

This only gets it, not write it, to write it we use

document.write(dt)

Simple huh?

If you want to take this further you could use if else, to show a different message for the time of day.

Sorry this is so small, there isn't much to explain.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users