VBA: How to get date as a string yyyy-mm-dd
Use the Format
function from the VBA.Strings
built-in module:
Debug.Print Format(Now, "YYYY-MM-DD")
Dim sToday As String
sToday = CStr(Date)
That gives sToday value, e.g. "2020-12-31", in the format of my system's date.