Formatting partial unknown dates with DateTime() from a database?

susi

New Member
I have a database that has a few unknown months or days formatted like so: \[code\]1999-01-00\[/code\] / \[code\]1999-00-00\[/code\].Now, I've been using \[code\]DateTime()\[/code\] to format the days that are full, which works fine.I'd like to have abbreviations for unknown days, but known months using \[code\]$DateTime->format('M Y');\[/code\] which outputs \[code\]Sep 1999\[/code\]and\[code\]$DateTime->format('Y');\[/code\] for \[code\]1999\[/code\] that is for unknown months and days.\[code\]DateTime()\[/code\] Doesn't allow \[code\]00\[/code\] values for months/days, so what are some ways to get around this?
 
Back
Top