Flutter/Dart: DateFormat (using intl): how to remove zero prefix?

31 Views Asked by At

I am using intl pakage's DateFormat class to format dates with a format like this:

_standardDateFormat = DateFormat('MMM dd, yyyy');

This produces strings like Feb 01, 2023.

How can I have the date without the prefix of 0 when it's a single-digit date? I would like to show Feb 1, 2023. I have tried d, dd, c but they all render with the prefixed 0.


If it's a double-digit date, I would of course like to show both digits: Mar 13, 2023.

1

There are 1 best solutions below

0
or9ob On

Update: the single d format is indeed working, but I needed to restart flutter build to see the effect (not sure why).