I ran accross a field in a flat file yesterday that was in the format of "CCYYDDD". Now I can only assume that "CC" means century, but that's not the point. The actual value was "2008294". I needed to write an expression that converted the year and day of year format to a standard date. Here's the expression to do this (thank you to Ed Buhain for brainstorming):
DATEADD("d", ((DT_I4)SUBSTRING(Date, 5, 3) - 1), (DT_DATE)("1/1/" + SUBSTRING(Date, 1, 4)))
Where "Date" is the value you need to convert.
Pretty straight forward. Just subtact 1 from the day of year value and add to January 1st using DateAdd. The end result in this case is "10/20/2008"