Time Culverts in ASP

zhaozj2021-02-17  44

In the ASP, there is a NOW of the current time, there is a Date of the current date, and the Month, Month (Date), DAY (Date) is not taken as the previous year. The mandate, so according to today is a few days of the WEEKDAY (Firstdate)) of this week, and the DateAdd's mandate can be written (:, and also considering the New Year's Eve " The problem.

code show as below

Weeknum = weekday (Dateadd ("D" ((Date) 1), Date) 'The Week Number of First Date of this MonthfirstDate = DateAdd ("D", ((DAY (DATE)) 1), Date) 'The First Date of this Monthldt_prevmon = dateadd ("D", - 1, firstdate)' The last date of prev Monthfirstdate_lstmon = dateadd ("d", (- (DAY (LDT_PREVMON)) 1) , LDT_PREVMON) 'THE FIRST DATE OF Last Weekcount = 0 for DD = 1 To Day (LDT_PREVMON) IF (WeekDay ("D", DD, Firstdate_lstmon) = 1) THEN Weekcount = Weekcount 1 Endiff Day ( Date) <= (8-weekday (firstdate)) THEN WeekordNew = weekcount 1 ok = year (DateAdd ("M", - 1, Firstdate) & "Year" & Month (DateAdd ("M", - 1, Firstdate)) & "Month" & WeekordNew & "Week" Else Weekord = Int (DAY (DATE) --Weekday (Date) / 7 1) OK = Year (Date) & "Year" & Month (Date) & "Month" & Weekord & "Week" end if

转载请注明原文地址:https://www.9cbs.com/read-30143.html

New Post(0)