We help IT Professionals succeed at work.

Convert Day of the Year to month and day

NGTLD
NGTLD asked
on
I need to convert a date that is given as the day of the year i.e. 226 the year is seperate in standard format. I need to convert the 226 to a month and day. I cannot find anything that does this. Can anyone hep?
Comment
Watch Question

Commented:
Get the milliseconds of the Year you know.. @ Jan 1st 00:00:00.

Add 226 days milliseconds.. to the above.

Then you can get all the values
Software Architect
Top Expert 2010
Commented:
Hey NGTLD,

Here is a script to add 226 days to the current year.


<html>
<script type="text/javascript">

var days = 226;
var today = new Date();
var thisYear = today.getFullYear();
var newDate = new Date(thisYear,0,days,0,0,0,1);

alert(newDate);
</script>
</html>

Open in new window

Author

Commented:
Perfection man Thanks