VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Date calculations

by Anitha (5 Submissions)
Category: OLE/COM/DCOM/Active-X
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 27th September 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Date calculations

Rate Date calculations



Text1.Text = DTPicker1.Value 'To get the date
Text2.Text = DTPicker1.Day 'To get the Day
Text3.Text = DTPicker1.Month 'To get the Month
Text4.Text = DTPicker1.Year ' To get the Year
Text5.Text = DTPicker1.DayOfWeek ' To get the Day of the Week
Text6.Text = Format(DTPicker1.Value, "DD-MM-YYYY", vbSunday, vbFirstFullWeek) 'To set the date format as required
Text7.Text = DateAdd("d", 10, "01/02/2001") ' To add 10 days to the given date
Text8.Text = DateAdd("m", 10, "01/02/2001") 'To add 10 months to the given date
Text9.Text = DateAdd("yyyy", 10, "01/02/2001") 'To add 10 years to the given date
Text10.Text = DateDiff("d", "01/05/2001", "01/30/2001") 'To find the number of days between any two dates
End Sub



Download this snippet    Add to My Saved Code

Date calculations Comments

No comments have been posted about Date calculations. Why not be the first to post a comment about Date calculations.

Post your comment

Subject:
Message:
0/1000 characters