PHP: Convert Day of Year to Day of Month and Month
date, php, timestamp
Solution
strtotime("January 1st +".($days-1)." days");
This will return a timestamp corresponding to the specified day of the year.
Problem
If you have the day of the year. How can you convert that to day of month and month? For example: The day "144" should be converted to 26th of May. I guess I also have to add the actual year to account for leap years. But I haven't found anything at all. For example the function mktime() exepects the month, year and day of month. Anybody some suggestions?