vbsは月の最初と最後の日付を取得します

Dim TargetDate、StrYear、StrMonth、StrDay
 Dim StartDate、Strtime 

TargetDate = Date 
' 获取年月日 
StrYear = Year (TargetDate)
StrMonth = Month (TargetDate)
 If  Len(strMonth)< 2  Then 
StrMonth = " 0 "StrMonth
 End  If 
StrDay = " 01 " 
' 
开始日 StartDate = StrYear&StrMonth&StrDay
 ' 结束日期 
Strtime = DateSerial(今)、(今)+ 11 - 1 の場合 でlen(Strtime))< 2  次に
StrMonth = " 0 "ヶ月(Strtime)
 終了 の場合
LastDate = (Strtime)&StrMonth&デイ( Strtime)
 MsgBox StartDate&" | "&LastDate

 

おすすめ

転載: www.cnblogs.com/lnd-blog/p/12674873.html