LoginSignup
0
0

More than 1 year has passed since last update.

[javascript]現在日時を1行で yyyy-mm-dd で取得する

Posted at

毎回忘れるのでメモ

yyyy-mm-dd

  let now = new Date().toISOString().split("T")[0];
-> 2022-04-06

yyyy/mm/dd

  let now = new Date().toISOString().split("T")[0].replaceAll("-", "/");
-> 2022/04/06
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0