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

yyyy-mm-dd hh:nn:ssのようなタイムスタンプ文字列を作りたい

Posted at

VBAでyyyy-mm-dd hh:nn:ssのようなタイムスタンプ文字列を作るにはFormat関数を利用します。

Sub Main()
    Dim timestamp As String
    timestamp = Format(Now(), "yyyy-mm-dd hh:nn:ss")
    Debug.Print timestamp
    '=> 2024-04-05 16:28:31
End Sub

よく利用する処理ですが、必要なタイミングのたびに忘れるので、自分用のメモとして残しておきます (´・ω・`)

0
0
0

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?