is it possible to create a jQuery function so that it gets current date and time? I\'ve been looking around documentation but haven\'t found anything so far...
Annoyingly Javascript's date.getSeconds() et al will not pad the result with zeros 11:0:0 instead of 11:00:00.
date.getSeconds()
11:0:0
11:00:00
So I like to use
date.toLocaleTimestring()
Which renders 11:00:00 AM. Just beware when using the extra options, some browsers don't support them (Safari)
11:00:00 AM
Documentation