| {\rtf1\ansi\ansicpg1252\deff0\deflang1044{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}} {\colortbl ;\red0\green0\blue255;} \viewkind4\uc1\pard\f0\fs17 This program tells you the weekday of your birth, for ex: put 20/7/2002 and it tells you that this day is saturday, also it calculates your age exactly : years,months,days,hours,minutes, seconds. \par \par 'just construct a textbox and name it "ff" \par \par \par Dim r As Integer \par Dim p As Integer \par Private Sub Command1_Click() \par p = 0 \par qq.Visible = False \par 'If m1 > 12 Or d1 > 31 Then vv.Visible = True: vv.Caption = "month must be less than 12 and day must be less than 31": Exit Sub \par Timer1.Interval = 100 \par End Sub \par \par Private Sub Command2_Click() \par p = p + 1 \par Timer1.Interval = 0 \par Label1.Caption = "" \par Label2.Caption = "" \par Label3.Caption = "" \par Label4.Caption = "" \par Label5.Caption = "" \par Label6.Caption = "" \par Label7.Caption = "" \par If p = 1 Then Command2.Caption = "press again" \par If p = 2 Then ff = "": Command2.Visible = False: Command2.Caption = "i wanna enter another date": qq.Visible = True \par End Sub \par \par Private Sub Form_Load() \par qq.Visible = False \par End Sub \par \par Private Sub Image1_Click() \par End \par End Sub \par \par Private Sub Image2_Click() \par Label17.Visible = True \par End Sub \par \par Private Sub Timer1_Timer() \par m = Weekday(ff) \par Select Case m \par Case 1 \par fday = "sunday" \par Case 2 \par fday = "monday" \par Case 3 \par fday = "tuesday" \par Case 4 \par fday = "wednesday" \par Case 5 \par fday = "thursday" \par Case 6 \par fday = "friday" \par Case 7 \par fday = "saturday" \par End Select \par 'Print fday \par d1 = Day(ff) \par m1 = Month(ff) \par Y1 = Year(ff) \par d2 = Day(Date) \par m2 = Month(Date) \par Y2 = Year(Date) \par 'Print d1, m1, Y1 \par 'Print d2, m2, Y2 \par Label15.Visible = True \par vv.Visible = False \par If Y1 > Y2 Then vv.Visible = True: vv.Caption = "please enter a date older than today's date": Timer1.Interval = 0: Label15.Visible = False: Exit Sub \par If d2 < d1 Then m2 = m2 - 1: d2 = d2 + 30 \par If m2 < m1 Then Y2 = Y2 - 1: m2 = 12 + m2 \par d = Abs(d2 - d1) \par m = Abs(m2 - m1) \par y = Abs(Y2 - Y1) \par Label1.Caption = y \par Label2.Caption = m \par Label3.Caption = d \par sec = Second(Time) \par Min = Minute(Time) \par ho = Hour(Time) \par Label4.Caption = ho \par Label5.Caption = Min \par Label6.Caption = sec \par Label7.Caption = fday \par Command2.Visible = True \par End Sub \par \par \cf1 Private Sub Timer2_Timer() \par \cf0\tab Randomize Timer \par \tab t1 = Int(255 * Rnd) \par \tab t2 = Int(255 * Rnd) \par \tab t3 = Int(255 * Rnd) \par \par \tab ff.BackColor = RGB(t1, t2, t3) \par \tab 'ff.BackColor = QBColor(t) \par \cf1 End Sub\cf0 \par \par \par \par } |
Calculate birth weekday |
India web developer web development India | India web development company India ecommerce web developer