tip-archive
tip-archive copied to clipboard
Safari에서 Date를 다룰 때 신경써야 하는 것들 정리
현상
플랫폼간 자바스크립트의 new Date()
를 처리하는 방식이 다르다.
해결
1. Timezome을 함께 붙인다.
const dateText = '2020-07-01'
new Date(`${dateText}+09:00`)
2. Date.now()
를 사용한다.
new Date(Date.now())