Sure, it's possible. But it's difficult to get more specific than that without knowing what kind of database you're using.
How you do it depends on the database you're using. MySQL, for example, has a date_format() function which allows you to format a date value as you need. With another data source, you may have to use PHP's strtotime() and date() functions.
As far as I'm aware, most databases require the day of the month as part of the date. However, you can retrieve just the month and the year if that's all you need.
If I am using just the month and year, I always set the day to 1 (i.e. 01-mm-yyyy for whatever mm and yyyy) in the database, and then disregard the 01 after retrieving the date.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.