1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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
1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?