[JavaScript] 타임스탬프를 yy.mm.dd 날짜로 바꾸기

유얌얌·2024년 7월 26일
0

JavaScript

목록 보기
30/30

타임스탬프

new Date().getTime()

1970년 1월 1일 00시 00분 00초부터 현재시간까지 얼마나 시간이 지났는지를 ms단위로 보여주는 숫자(number)

타임스탬프 -> yy.mm.dd 날짜 변환

const timeStamp = new Date().getTime();
const date = new Date(timeStamp).toLocaleDateString()  // 24.07.27
profile
조금씩이라도 꾸준하게

0개의 댓글

관련 채용 정보