spires Posted March 25, 2008 Share Posted March 25, 2008 Hi Guys Can anyone tell me how to make the month and year miss out the zeros? Example: 03 - becomes - 3 08 - becomes - 8 13 - stays as - 13 Basically, the zero is removed from the start of the month & year. Thanks guys Link to comment https://forums.phpfreaks.com/topic/97760-simple-data-question/ Share on other sites More sharing options...
ansarka Posted March 25, 2008 Share Posted March 25, 2008 http://in.php.net/date Month --- --- F A full textual representation of a month, such as January or March January through December m Numeric representation of a month, with leading zeros 01 through 12 M A short textual representation of a month, three letters Jan through Dec n Numeric representation of a month, without leading zeros 1 through 12 t Number of days in the given month 28 through 31 Year --- --- L Whether it's a leap year 1 if it is a leap year, 0 otherwise. o ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. (added in PHP 5.1.0) Examples: 1999 or 2003 Y A full numeric representation of a year, 4 digits Examples: 1999 or 2003 y A two digit representation of a year Examples: 99 or 03 Link to comment https://forums.phpfreaks.com/topic/97760-simple-data-question/#findComment-500199 Share on other sites More sharing options...
zenag Posted March 25, 2008 Share Posted March 25, 2008 day and month format.. echo (date("j:n")); Link to comment https://forums.phpfreaks.com/topic/97760-simple-data-question/#findComment-500201 Share on other sites More sharing options...
spires Posted March 25, 2008 Author Share Posted March 25, 2008 Hi Guys Thats excellent Thanks Link to comment https://forums.phpfreaks.com/topic/97760-simple-data-question/#findComment-500204 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.