Use MM
for months. mm
is for minutes.
DateTime.Now.ToString("dd/MM/yyyy");
You probably run this code at the begining an hour like (00:00
, 05.00
, 18.00
) and mm
gives minutes (00
) to your datetime.
From Custom Date and Time Format Strings
"mm" --> The minute, from 00 through 59.
"MM" --> The month, from 01 through 12.
Here is a DEMO
. (Which the month part of first line depends on which time do you run this code ;)
)