I was in urgent need to convert Julian date to Georgian for a asp.net application which reads data from DB2.
The following code was useful.
public static string JulianToDateTime(int julianDate)
{
int RealJulian = julianDate + 1900000;
int Year = Convert.ToInt32(RealJulian.ToString().Substring(0, 4));
int DoY = Convert.ToInt32(RealJulian.ToString().Substring(4));
DateTime dtOut = new DateTime(Year, 1, 1);
return dtOut.AddDays(DoY - 1).ToShortDateString();
}
Hope It HelpsRegards
Fauzi
No comments:
Post a Comment