I have an integer that represents the day of year i also have another integer that represents the year. I need to somehow convert both of these numbers into a date using vb.net.
TheNige
3:39 am on Dec 17, 2005 (gmt 0)
This should work; there may be other ways..basically creating a new date for January 1st for the selected year then adding the number of days - 1 (since you are starting at day 1 and not 0):
Dim myDay As Integer = 54 Dim myYear As Integer = 2005 Dim baseDate As New Date(myYear, 1, 1) Dim myDate As Date = baseDate.AddDays(CType(myDay - 1, Double))
john_k
6:28 am on Dec 18, 2005 (gmt 0)
Use the DateSerial function.
someDate = DateSerial(lYear, 1, lDay)
Where lYear and lDay are your provided year and day-of-the-year.