top of page

This Program basically consists of (3) Sub Routines

The Program basically computes the No. of Days between to given two Dates

The Computational Code can be used for any Time Based Applications.

The Variables are Dimensioned in Public Class Form for Computational access in Private Sub Sectors

(1st) Sub Routine - The user inputs the 1st and 2nd Dates into the corresponding TextBox's.

(2nd) Sub Routine - The Days between Dates are then Calculated by the 

                            Mathematical Formula's.

(3rd) Sub Routine - The Formulated Values are then assigned to the Corresponding Labels

                            to be viewed in the Visual Basic Run Time Application.

Basic Examples - Battle of Pinkie Cleugh (Rough Wooing)

                     Commence Date Format      = 10 Sep 1547

                     Current Date Format           = 12 May 2019

                     Calculated Days since Battle = 172274

                     Calculated Years                 = 471.98

Basic Examples - 911 Twin Towers Terrorist Attack

                        Commence Date Format      = 11 Sep 2001

                        Current Date Format           = 12 May 2019

                        Calculated Days since attack = 6452

                        Calculated Years                  = 17.68

 

 

 

 

Basic Examples - Shane Partridge : Neo-Bladder

                        Shane's Prostatectomy Reconstruction

                        Urothelial Carcinoma

                        Stage T1 Bladder Cancer Diagnosis.

                        Operation Date :

                        Commence Date Format        = 23 Jun 2017

                        Current Date Format             = 23 Jun 2019

                        Calculated Days since

                        Neo-Bladder Construction      = 730

                        Calculated Years                    = 2

Basic Examples - Bob Barker : Sinking the Pirate Ship Thunder

                         ##Loose Lips Sinks Ships## 

                        Commence Date Format        = 7 Apr 2015

                        Current Date Format             = 12 May 2019

                        Number of Days on Sea Bed   = 1496

                        Calculated Number of Years    = 4.099

               

 

 

Basic Examples - ODA 595 : Operational Detachment Alpha's

                      Operation Jaw Breaker

                      Rashid Dostum - Northern Alliance.

                      Commencement Date Format      = 19 Oct 2001

                      Current Date                              = 12 May 2019

                       Number of Days since Dispatched = 6414

                       Number of Years                         = 17.57

 

 

The Code

Public Class Form1

    Dim FirstDate As String
    Dim
CalculateFirstDate As Date

    Dim SecondDate As String
    Dim
CalculateSecondDate As Date

    Dim DTD As Single
    Dim
CountDays As Single
    Dim
TotalYears As Single

    Dim DecimalPlace As String = "n3"

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        'Sub Rountine(1)
        '## Input Date for Calculus ##

        InputDateValue()

        'Sub Routine(2)
        '## Calculate Days Difference ##

        InputCalculateDays()

        'Sub Rountine(3)
        '## Assign Values to Labels ##

        InputAssigntoLabels()

    End Sub

    ' ## Sub(1) ##
    Sub InputDateValue()

        FirstDate = TextBox1.Text
       
CalculateFirstDate = CDate(FirstDate)

        SecondDate = TextBox2.Text
        CalculateSecondDate = CDate(SecondDate)

    End Sub

    '## Sub(2) ##
    Sub InputCalculateDays()

        DTD = DateDiff(DateInterval.Day, CalculateFirstDate, CalculateSecondDate)
       
CountDays = Math.Abs(DTD * 1)
       
TotalYears = (CountDays / 365)

    End Sub

    ' ## Sub(3) ##
    Sub InputAssigntoLabels()

        Label1.Text = CountDays
        Label2.Text = TotalYears.ToString(DecimalPlace)

    End Sub

End Class
 

Website Links [Excel]-60.jpg
Acrobat Adobe Reader-27.jpg
Acrobat Adobe Reader-16.jpg
Website Links-173.jpg
War on Terrorism-10.jpg
Website Links-p175.jpg
bottom of page