I can't find a good jquery date and time that displays my selected date and time like this
11-Aug-2010 12:30:38
. Any good one you have seen...
views:
55answers:
3
A:
Not the prettiest, but this works:
function getDateStr()
{
var d=new Date();
var m=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
return len(d.getDate())+'-'+m[d.getMonth()]+'-'+d.getFullYear()+' '+len(d.getHours())+':'+len(d.getMinutes())+':'+len(d.getSeconds());
}
function len(s)
{
if((s+' ').length<3)
{
return '0'+s;
}
return s;
}
Call getDateStr() to receive the date in that format.
Kranu
2010-08-04 07:18:12