Derek Adair
Derek Adair

Reputation: 21935

Datestring formatting

I've been working a lot with dates and various capacities for the past month. I can't seem to find any decent documentation on working with dates in javascript.

for example: PHPfreaks has a wonderful explanation of any and all date() functions.

I just want to make sure I am properly utilizing all of the date object's methods.

W3schools has the best explanation that i've found.

So i'm taking the opportunity to utilize SO -

  1. What are the methods attached to the date object? (found @ w3schools)
  2. If you are inclined, list any interesting or useful scripts with the date obj (including odd behavior)

Upvotes: 2

Views: 4616

Answers (2)

rosscj2533
rosscj2533

Reputation: 9323

I found the w3schools link to be helpful. I think it does list all date methods, including getMonth().

One odd behavior thing to take note of is that getMonth returns the month in terms 0-11, where getDate returns day of the month 1-31, so when using getMonth you need to know to add 1 if you want the month in terms 1-12.

Upvotes: 1

Related Questions