|
得到一个日期当月第一天,最后一天是星期几
正 文:
得到一个日期当月第一天是星期几
Function getYMweekday(sDate As Date) As String
Dim intY As Integer
Dim intM As Integer
intY = Year(sDate)
intM = Month(sDate)
getYMweekday = WeekdayName(Weekday(DateSerial(intY, intM, 1)))
End Function
得到一个日期当月最后一天是星期几
Function getYMweekdayEnd(sDate As Date) As String
Dim intY As Integer
Dim intM As Integer
intY = Year(sDate)
intM = Month(sDate)
getYMweekdayEnd = WeekdayName(Weekday(DateSerial(intY, intM + 1, 0)))
End Function
Sub aa()
Debug.Print getYMweekday(Date)
Debug.Print getYMweekdayEnd(Date) 'date为2007-12-3
End Sub
|
|