I need to get the month number from a date using String.Format. But it doesn't seem to work correctly.
string.Format("{0:M}", entity.OrderPeriodDate)
Comes back with "June 15" and not 6 as many posts say.
string.Format("{0:MM}", entity.OrderPeriodDate)
Comes back with "06".
I need to get it without the leading zero. "M" is supposed to do that.
How can I get this correctly?
Thanks,
Tom
string.Format("{0:M}", entity.OrderPeriodDate)
Comes back with "June 15" and not 6 as many posts say.
string.Format("{0:MM}", entity.OrderPeriodDate)
Comes back with "06".
I need to get it without the leading zero. "M" is supposed to do that.
How can I get this correctly?
Thanks,
Tom