Friday, June 08, 2007

Georgian to Julian date - C#

How do i convert from Georgian date to Julian Date in .net 2.0 - C#?
Very simple..... but thought of sharing this because i got confused myself for a second.

btw, quick intro Georgian dates are the one's that we normally use in our day to day life - mm/dd/yyyy format or similar. Julian dates are more like numbers that we find in Excel kind of tools. I came across this when i had a requirement where one of the web service was expecting Julian kind of format. So to cut the crap... this one line of code helps you to convert from Georgian date format to Julian in .net -
private static string GetJDate(DateTime gdate)
// Georgian date - "06/07/2007" Julian date - "39240";
return gDate.ToOADate().ToString();

Cheerio - Dipesh Joshi
Coming soon - Please spare some time to check my videos soon on YouTube and Google videos :) (I will update this post)

1 comment:

Rey Entrolizo said...
This comment has been removed by the author.