|
-
Apr 15th, 2005, 01:09 AM
#1
Thread Starter
New Member
Julian Date
I know there is a Julian Date function in Vb.Net but I don't know how to use it I'm new to VB.Net. I want to get the Julian Date of the given system date.
e.g. vDate = #4/15/2005#
m = JulianDate(vdate)
Result: 2005105
Could anybody help me how to do this? In VB6 to get the number of Days in a year I use format function (format(date,"Y")) but don't know in VB.Net
Thanks,
Jbats
-
Apr 15th, 2005, 02:38 AM
#2
Re: Julian Date
I'm not sure how to answer your q exactly, but if you want to just format a dateTime object (ie, NOW) then do something like this:
DateTime.Now.ToString("d")
for a list of strings you can use to format dates look up here Date and Time Format Strings (click on Standard DateTime Format Strings on the left hand side)
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Apr 15th, 2005, 02:41 AM
#3
Re: Julian Date
I dunno what the julian calender really is but there is a class for it
System.Globalization.JulianCalendar
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Apr 1st, 2008, 11:22 AM
#4
Addicted Member
Re: Julian Date
vb.Net Code:
Private Function JulianToStandard(ByVal vDate As String) As Long
JulianToStandard= CLng(Format(Year(vDate), "0000") + Format(DateDiff("d", CDate("01/01/" + Format(Year(vDate), "0000")), vDate) + 1, "000"))
End Function
Old thread, but I was trying to figure it out myself and noticed this one might not have been completely answered.
Found code snippet from
http://www.freevbcode.com/ShowCode.asp?ID=5669
-
Apr 1st, 2008, 11:42 AM
#5
Re: Julian Date
Couldn't you simply re-arrange things?
Code:
Function GetJulianDate (ByVal TheDate As DateTime) As String
Return TheDate.Year.ToString & TheDate.Month.ToString & TheDate.Day.ToString
End Function
-
Apr 1st, 2008, 11:48 AM
#6
Fanatic Member
Re: Julian Date
Here is the MSDN link to the Julian Date formating and calculations
http://support.microsoft.com/kb/116281
Hope this helps
CLanguage; 
IF Post = HelpFull Then
RateMe
Else
Say("Shut UP")
End If
DotNet rocks
VB 6, VB.Net 2003, 2005, 2008, 2010, SQL 2005, WM 5.0,ahem ?OpenRoad?
-
Apr 1st, 2008, 11:52 AM
#7
Re: Julian Date
from MSDN
"The date January 1, 2001 A.D. in the Gregorian calendar is equivalent to the 19th day of December in the year 2000 A.D. in the Julian calendar.
Currently, the JulianCalendar is not used by any of the cultures supported by the CultureInfo class. Therefore, the JulianCalendar class can be used only to calculate dates in the Julian calendar."
The following has formulas:
http://scienceworld.wolfram.com/astr...ulianDate.html
-
Apr 1st, 2008, 05:34 PM
#8
Addicted Member
Re: Julian Date
 Originally Posted by JuggaloBrotha
Couldn't you simply re-arrange things?
Code:
Function GetJulianDate (ByVal TheDate As DateTime) As String
Return TheDate.Year.ToString & TheDate.Month.ToString & TheDate.Day.ToString
End Function
Probably.
I needed to take a standard date (01/01/2008) and convert to julian date (001) and the function I posted worked well.
Last edited by Zero2Cool; Apr 2nd, 2008 at 07:05 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|