Converting Date to Julian Calendar format

Hi, can anyone help with how I can convert a date to a Julian format

e.g converting 10-Nov-2020 to 2020/315

@mishaelfash
one option would be
parse 10-Nov-2020 into a datetime with datetime.parsexact method

myDate = DateTime.ParseExact("10-Nov-2020","dd-MMM-yyyy", CultureInfo.InvariantCulture)

then use:

strJulianDate = String.Format("{0}/{1}", myDate.ToString("yyyy"), myDate.DayOfYear.ToString("000"))

Also have a look here:

2 Likes

Works perfectly… thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.