Skip to content

Instantly share code, notes, and snippets.

@lanqy
Created February 16, 2013 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lanqy/4965777 to your computer and use it in GitHub Desktop.
Save lanqy/4965777 to your computer and use it in GitHub Desktop.
时间戳转换成类似2012-12-20 的时间格式
_fullDate: function(time){ //转换成类似 2012-12-20 的时间格式
var date = new Date(time);
return date.getFullYear() + '-' + (date.getMonth() >= 9 ? '' : '0') + (date.getMonth() + 1) + '-' + (date.getDate() > 9 ? '' : '0') + date.getDate();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment