function created_time() { var date = new Date(); var formattedDate = moment(date).format('YYYY-MM-DD HH:mm:ss'); return formattedDate; }
YYYY = 년
MM = 월
DD = 일
HH = 시(HH는 24시 단위, hh면 12시 단위, A hh or P hh는 12시 단위에 am pm을 표시)
mm = 분
ss = 초
'About_JavaScript' 카테고리의 다른 글
[자바스크립트]문자열 중 엔터값 치환하는 함수 (0) | 2016.11.17 |
---|---|
[자바스크립트]첨부된 사진 미리보기 함수 (0) | 2016.11.17 |