
[React] date format / moment / react YYYYMMDD YYYY-MM-DD
๐จ๐ป๊ฐ๋ฐ/โ๏ธReact
2021. 8. 18. 09:42
const currentDate = new Date() console.log(currentDate) //Output: 2022-01-29T10:03:47.564Z ์ด์ ๊ป ๋ด์๋ Javascript์ ํ์์ด๋ค! ๐Monent ๐How to Install ๐npm ๋๋ yarn ์ ์ด์ฉํ ์ค์น ๋ช ๋ น์ด $ npm install moment --save // ๋๋ $ yarn add moment ๐ Code Sample ์ฝ๋ ์์ import "./index.css" import Moment from 'moment'; import "moment/locale/ko"; // Locale Setting function App() { const formatDate = Moment().format('YYYY-MM-DD'..