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 bes开发者_StackOverflowt explanation that i've found.
So i'm taking the opportunity to utilize SO -
- What are the methods attached to the date object? (found @ w3schools)
- If you are inclined, list any interesting or useful scripts with the date obj (including odd behavior)
This is a good reference: https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Date
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.
精彩评论