grutherford
7 years agoOccasional Contributor
can aqDateTime.GetMonth return a 2 character month? Same with GetDay?
I need to get a 2 character month and day from an input string (e.g., 20180109). The aqDateTime.GetMonth strips the leading 0 when the month or day is less than 10.
You can wrap the result in the string format that you want to use:
You can use aqConvert.DateTimeToFormatStr with the %m (month) or %d (day) specifiers:
aqConvert.DateTimeToFormatStr(dateTime, "%m")
or aqString.Format as Marsha_R suggested:
aqString.Format("%02d", aqDateTime.GetMonth(dateTime))