简体   繁体   中英

good jquery/javascript date and time picker for this format?

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...

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.

http://jqueryui.com/具有最佳的日期选择器IMO!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM