JulianDate

  • Thread starter Thread starter Sueffel
  • Start date Start date
S

Sueffel

I can't find anything decent on how to convert a regular DateTime, or a
string, to Julian Date. Help?

Thanks,
Sueffel
 
That's kool, but, I may have been misunderstood. I need to convert 1/1/04
to 04001, and I'm native to VB.NET, so it makes thing even more difficult.

Thank,
Sueffel
 
hi
one other way to go about it is to convert the data to string ( using the
ToString() method of the data object ) then do the manipulation on the
string it self , I think this would be easier since you will find a lot of
simple examples on how to handle strings ....
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Sueffel said:
That's kool, but, I may have been misunderstood. I need to convert 1/1/04
to 04001, and I'm native to VB.NET, so it makes thing even more difficult.

It looks like you want a date formatted as YYDDD, where DDD is the
number of days into the particular year. This is sometimes called a
Julian Date Format, confusingly so, since it really has nothing to do
with a Julian Date (as astronomers use it).

Anyway, you can get what you want with something like:

String.Format( "{0:2}{1:3}", dt.ToString( "yy"),
dt.DayOfYear.ToString( "000"))
 
Back
Top