I’m trying to produce just the day number in a WPF text block, without leading zeroes and without extra space padding (which throws off the layout). The first produces the day number with a space, the second produces the entire date. According to the docs, ‘d’ should produce the day (1-31).
string.Format('{0:d }', DateTime.Today); string.Format('{0:d}', DateTime.Today);
UPDATE:Adding % is indeed the trick. Appropriate docs here.
See here
Otherwise d is interpreted as:
PS. For messing around with format strings, using LinqPad is invaluable.