Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
**********************************************************
* Julian Dates * X *
**********************************************************
* *
* Month Day Julian Date Is: *
* ______________ __ _______ *
* Date 1: | July |\/| | | | | *
* ---------------- |__| |_______| *
* *
* ______________ __ _______ *
* Date 2: | July |\/| | | | | *
* ---------------- |__| |_______| *
* *
* ______________ __ _______ *
* Date 3: | July |\/| | | | | *
* ---------------- |__| |_______| *
* *
* ______________ __ _______ *
* Date 4: | July |\/| | | | | *
* ---------------- |__| |_______| *
* *
* _______________ _________ __________ *
* Is Leap Year? | | | | | | *
* ___ | Calc Date | | Clear | | Exit | *
* |___| |_____________| |_______| |________| *
* *
* *
**********************************************************
Option Explicit
Dim strDay1 As String
Dim strDay2 As String
Dim strDay3 As String
Dim strDay4 As String
Dim strText1 As String
Dim strText2 As String
Dim strText3 As String
Dim strText4 As String
Dim strStartDay As String
Private Sub cmdCalc_Click()
If chkBox = False Then
strStartDay = CStr("January 1, 1999")
If txt1.Text = "" Then
Else
strDay1 = CStr(lst1.Text) + " " + CStr(txt1.Text) + ", " + CStr("1999")
strText1 = DateDiff("d", strStartDay, strDay1) + 1
lbl1.Caption = "The Julian Day for " + lst1.Text + " " + txt1.Text + " is " + strText1 + "."
End If
If txt2.Text = "" Then
Else
strDay2 = CStr(lst2.Text) + " " + CStr(txt2.Text) + ", " + CStr("1999")
strText2 = DateDiff("d", strStartDay, strDay2) + 1
lbl2.Caption = "The Julian Day for " + lst2.Text + " " + txt2.Text + " is " + strText2 + "."
End If
If txt3.Text = "" Then
Else
strDay3 = CStr(lst3.Text) + " " + CStr(txt3.Text) + ", " + CStr("1999")
strText3 = DateDiff("d", strStartDay, strDay3) + 1
lbl3.Caption = "The Julian Day for " + lst3.Text + " " + txt3.Text + " is " + strText3 + "."
End If
If txt4.Text = "" Then
Else
strDay4 = CStr(lst4.Text) + " " + CStr(txt4.Text) + ", " + CStr("1999")
strText4 = DateDiff("d", strStartDay, strDay4) + 1
lbl4.Caption = "The Julian Day for " + lst4.Text + " " + txt4.Text + " is " + strText4 + "."
End If
Else
strStartDay = CStr("January 1, 2000")
If txt1.Text = "" Then
Else
strDay1 = CStr(lst1.Text) + " " + CStr(txt1.Text) + ", " + CStr("2000")
strText1 = DateDiff("d", strStartDay, strDay1) + 1
lbl1.Caption = "The Julian Day for " + lst1.Text + " " + txt1.Text + " is " + strText1 + "."
End If
If txt2.Text = "" Then
Else
strDay2 = CStr(lst2.Text) + " " + CStr(txt2.Text) + ", " + CStr("2000")
strText2 = DateDiff("d", strStartDay, strDay2) + 1
lbl2.Caption = "The Julian Day for " + lst2.Text + " " + txt2.Text + " is " + strText2 + "."
End If
If txt3.Text = "" Then
Else
strDay3 = CStr(lst3.Text) + " " + CStr(txt3.Text) + ", " + CStr("2000")
strText3 = DateDiff("d", strStartDay, strDay3) + 1
lbl3.Caption = "The Julian Day for " + lst3.Text + " " + txt3.Text + " is " + strText3 + "."
End If
If txt4.Text = "" Then
Else
strDay4 = CStr(lst4.Text) + " " + CStr(txt4.Text) + ", " + CStr("2000")
strText4 = DateDiff("d", strStartDay, strDay4) + 1
lbl4.Caption = "The Julian Day for " + lst4.Text + " " + txt4.Text + " is " + strText4 + "."
End If
End If
End Sub
Private Sub cmdClear_Click()
lbl1.Caption = ""
lbl2.Caption = ""
lbl3.Caption = ""
lbl4.Caption = ""
txt1.Text = ""
txt2.Text = ""
txt3.Text = ""
txt4.Text = ""
lst1.ListIndex = Month(Date) - 1
lst2.ListIndex = Month(Date) - 1
lst3.ListIndex = Month(Date) - 1
lst4.ListIndex = Month(Date) - 1
End Sub
Private Sub Form_Load()
lst1.AddItem "January"
lst1.AddItem "February"
lst1.AddItem "March"
lst1.AddItem "April"
lst1.AddItem "May"
lst1.AddItem "June"
lst1.AddItem "July"
lst1.AddItem "August"
lst1.AddItem "September"
lst1.AddItem "October"
lst1.AddItem "November"
lst1.AddItem "December"
lst2.AddItem "January"
lst2.AddItem "February"
lst2.AddItem "March"
lst2.AddItem "April"
lst2.AddItem "May"
lst2.AddItem "June"
lst2.AddItem "July"
lst2.AddItem "August"
lst2.AddItem "September"
lst2.AddItem "October"
lst2.AddItem "November"
lst2.AddItem "December"
lst3.AddItem "January"
lst3.AddItem "February"
lst3.AddItem "March"
lst3.AddItem "April"
lst3.AddItem "May"
lst3.AddItem "June"
lst3.AddItem "July"
lst3.AddItem "August"
lst3.AddItem "September"
lst3.AddItem "October"
lst3.AddItem "November"
lst3.AddItem "December"
lst4.AddItem "January"
lst4.AddItem "February"
lst4.AddItem "March"
lst4.AddItem "April"
lst4.AddItem "May"
lst4.AddItem "June"
lst4.AddItem "July"
lst4.AddItem "August"
lst4.AddItem "September"
lst4.AddItem "October"
lst4.AddItem "November"
lst4.AddItem "December"
lst1.ListIndex = Month(Date) - 1
lst2.ListIndex = Month(Date) - 1
lst3.ListIndex = Month(Date) - 1
lst4.ListIndex = Month(Date) - 1
End Sub
Private Sub txt1_GotFocus()
txt1.SelStart = 0
txt1.SelLength = Len(txt1.Text)
End Sub
Private Sub txt2_GotFocus()
txt2.SelStart = 0
txt2.SelLength = Len(txt2.Text)
End Sub
Private Sub txt3_GotFocus()
txt3.SelStart = 0
txt3.SelLength = Len(txt3.Text)
End Sub
Private Sub txt4_GotFocus()
txt4.SelStart = 0
txt4.SelLength = Len(txt4.Text)
End Sub