With Boost datetime how do i create a month string padded with zero for the first 9 months?
So I need "05" not "5".
date Date(2012,05,1);
string monthStringAsNumber = lexical_cast<string>(date.Month().as_number());
// returns "5"
string monthStringAsNumberTwo = date.Month().as_short_string();
// returns "Aug"
I would like "05". How do i do this?
Thanks a lot.
You don't really need
lexical_cast
The following should work:or you could just go for this howler: