Skip to content

Instantly share code, notes, and snippets.

@lanqy

lanqy/fulldate.js

Created Feb 16, 2013
Embed
What would you like to do?
时间戳转换成类似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
You can’t perform that action at this time.