All the date formats

I put together this block to give me the current date in (almost) all possible formats needed. It’s very case sensitive, and has been tested against 2020.4.

I hope it helps somebody!

"Year (YYYY): " + System.DateTime.Now.Year.ToString + vbCrLf +
"Year (YY): " + System.DateTime.Now.Year.ToString.Substring(2)+ vbCrLf +
"Month (MM): " + System.DateTime.Now.ToString("MM") + vbCrLf +
"Month (M/MM): " + System.DateTime.Now.Month.ToString+ vbCrLf +
"Day (DD): " + System.DateTime.Now.ToString("dd")+ vbCrLf + 
"Day (D/DD): " + System.DateTime.Now.Day.ToString + vbCrLf + 
"Date (MM/DD/YYYY): " + System.DateTime.Now.Date.ToString("MM/dd/yyyy")
1 Like