how can I get the date in this format [mm/dd/yy] using javascript. I am struggling to get the 'year' to a 2 digit figure as opposed to the full 4 digits.
Thanks!
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
This guarantees 2 digit dates and months.
Try this:
HTML
JS
Fiddle: http://jsfiddle.net/kboucher/4mLe1Lrd/
How About this for the year
And since you need your Month from
01
through12
do thisDo the same thing for days, Minutes and seconds
Working Demo