Click here to Skip to main content
15,922,512 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralOptimisation Model Solution Routine(Linear Programming) Pin
karmond6-Apr-05 6:00
karmond6-Apr-05 6:00 
GeneralRe: Optimisation Model Solution Routine(Linear Programming) Pin
Dave Kreskowiak7-Apr-05 4:10
mveDave Kreskowiak7-Apr-05 4:10 
GeneralDatagrid Exporting to Excel Format Pin
Scttsmpsn6-Apr-05 4:53
Scttsmpsn6-Apr-05 4:53 
GeneralRe: Datagrid Exporting to Excel Format Pin
Scttsmpsn6-Apr-05 8:25
Scttsmpsn6-Apr-05 8:25 
QuestionSwitching language programmatically ? Pin
kil0byte^bandit6-Apr-05 4:30
kil0byte^bandit6-Apr-05 4:30 
GeneralMachine.Config Pin
Jason Weibel6-Apr-05 4:25
Jason Weibel6-Apr-05 4:25 
GeneralRe: Machine.Config Pin
Dave Kreskowiak6-Apr-05 4:59
mveDave Kreskowiak6-Apr-05 4:59 
GeneralConvert to(from) Julian Date Format from(to) Calendar Date Pin
Dile6-Apr-05 2:52
Dile6-Apr-05 2:52 
Hello! I need convert to(from) Julian Date Format from(to) Calendar Date.
Is there built in algorithm that allow to do this?

Now I do so:
' convert Calendar Date to Julian Date Format
Private Function GetJD(ByVal vDate As Date) As Integer
Dim y As Integer = vDate.Year
Dim m As Integer = vDate.Month
Dim d As Integer = vDate.Day
If m > 2 Then
m = m + 1
Else
y = y - 1
m = m + 13
End If
Dim JulianDate As Integer = Math.Floor(Math.Floor(365.25 * y) + Math.Floor(30.6001 * m) + d + 1720995)
JulianDate += 2 - Math.Floor(0.01 * y) + Math.Floor(0.25 * Math.Floor(0.01 * y))
Return Math.Floor(JulianDate - 0.5)
End Function

' convert Julian Date to Calendar Date Format
Private Function GetCD(ByVal JD As Integer) As Date
Dim g1, g2, g3, g4, g5 As Integer
Dim tmp As Integer = Math.Floor(((JD - 1867216.0) - 0.25) / 36524.25)
g1 = JD + 2 + tmp - Math.Floor(0.25 * tmp)
g2 = g1 + 1524.0
g3 = Math.Floor(6680 + ((g2 - 2439870) - 122.1) / 365.25)
g4 = Math.Floor(g3 * 365.25)
g5 = Math.Floor((g2 - g4) / 30.6001)
Dim d As Integer = Math.Floor(g2 - g4 - Math.Floor(g5 * 30.6001))
Dim m As Integer = Math.Floor(g5 - 1.0)
If m > 12 Then m -= 12
Dim y As Integer = Math.Floor(g3 - 4715.0)
If m > 2 Then y -= 1
If y <= 0 Then y = Abs(y - 1)
Return Date.Parse(d & "/" & m & "/" & y)
End Function

Thanks.
GeneralRe: Convert to(from) Julian Date Format from(to) Calendar Date Pin
kil0byte^bandit6-Apr-05 4:54
kil0byte^bandit6-Apr-05 4:54 
Generalvb Pin
royrana6-Apr-05 1:30
royrana6-Apr-05 1:30 
QuestionDeclare variable at runtime?? Pin
Sheel Gohe5-Apr-05 23:07
Sheel Gohe5-Apr-05 23:07 
AnswerRe: Declare variable at runtime?? Pin
Dave Kreskowiak6-Apr-05 2:20
mveDave Kreskowiak6-Apr-05 2:20 
GeneralRe: Declare variable at runtime?? Pin
royrana6-Apr-05 23:59
royrana6-Apr-05 23:59 
GeneralCOM property from VB Pin
Anonymous5-Apr-05 22:50
Anonymous5-Apr-05 22:50 
GeneralRe: COM property from VB Pin
Dave Kreskowiak6-Apr-05 2:19
mveDave Kreskowiak6-Apr-05 2:19 
GeneralUsing Access 2003 Methods Pin
dpagka5-Apr-05 19:29
dpagka5-Apr-05 19:29 
GeneralRe: Using Access 2003 Methods Pin
Dave Kreskowiak6-Apr-05 2:17
mveDave Kreskowiak6-Apr-05 2:17 
Generalopen ascii file Pin
toto_plg5-Apr-05 19:03
toto_plg5-Apr-05 19:03 
GeneralRe: open ascii file Pin
Christian Graus5-Apr-05 19:44
protectorChristian Graus5-Apr-05 19:44 
GeneralRe: open ascii file Pin
dpagka5-Apr-05 20:03
dpagka5-Apr-05 20:03 
GeneralRe: open ascii file Pin
Christian Graus5-Apr-05 20:05
protectorChristian Graus5-Apr-05 20:05 
GeneralProducing xml file from schema Pin
nitin_ion5-Apr-05 18:16
nitin_ion5-Apr-05 18:16 
GeneralRe: Producing xml file from schema Pin
Christian Graus5-Apr-05 18:39
protectorChristian Graus5-Apr-05 18:39 
GeneralRe: Producing xml file from schema Pin
nitin_ion5-Apr-05 20:14
nitin_ion5-Apr-05 20:14 
GeneralRe: Producing xml file from schema Pin
Christian Graus5-Apr-05 20:17
protectorChristian Graus5-Apr-05 20:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.