Public Class Form1
Function Hasil(ByVal MyYear As Integer, ByVal MyMonth As Integer) As Integer
Return DateTime.DaysInMonth(MyYear, MyMonth)
End Function
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Label9.Text
= Format(Today(), "dd-MMMM-yyyy")
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Label12.Text
= DateDiff(DateInterval.Day, DateTimePicker1.Value, Today())
& "Hari"
Label13.Text
= DateDiff(DateInterval.Month, DateTimePicker1.Value, Today())
& "Bulan"
Label14.Text
= DateDiff(DateInterval.Year, DateTimePicker1.Value, Today())
& "Tahun"
Label15.Text
= Format(DateAdd(DateInterval.Day, 1, DateTimePicker1.Value), "dd-MMMM-yyyy")
Label16.Text
= Format(DateAdd(DateInterval.Month, 2, DateTimePicker1.Value), "dd-MMMM-yyyy")
Label17.Text
= Format(DateAdd(DateInterval.Year, 3, DateTimePicker1.Value), "dd-MMMM-yyyy")
Label18.Text
= DateTimePicker1.Value.ToString("dddd")
Label19.Text
= Hasil(Year(DateTimePicker1.Text), Month(DateTimePicker1.Text))
End Sub
End Class
Tugas Anda Tinggal Hitung Jumlah dalam Setahun ?
Tidak ada komentar:
Posting Komentar