这题如何写代码?

来源:百度知道 编辑:UC知道 时间:2024/07/04 05:35:46
在窗体上显示如下内容
现在距离2008年元旦还有:208天
2008年的元旦是:星期1
本月份是:2007年10月
现在是:22时30分

我的QQ:736889169

Private Sub Command1_Click()
Print "现在距离2008年元旦还有: " & DateDiff("d", Now, DateValue("01/01/2008")) & " 天"
Print "2008年的元旦是: " & WeekdayName(Weekday(DateValue("01/01/2008"))); ""
Print "本月月份是: " & Format(Now, "yyyy年mm月")
Print "现在是: " & Format(Time, "hh时mm分")
End Sub

Private Sub Form_Load()
Dim D1 As Date
D1 = #1/1/2008#
Me.Print "现在距离2008年元旦还有: " & DateDiff("d", Now, D1) & " 天"
Me.Print "2008 年的元旦是: " & WeekdayName(Weekday(D1)); ""
Me.Print "本月份是:" & Year(Now) & "年" & Month(Now) & "月"
Me.Print "现在是:" & Hour(Time) & "时" & Minute(Time) & "分"

End Sub