# -*- coding: utf-8 -*- '''获取当前日期前后N天或N月的日期''' from time import strftime, localtime from datetime import timedelta, date import calendar year = strftime("%Y",localtime()) mon = strftime("%m",localtime()) day = strftime("%d",l…
NthDayOfWeek 计算并返回指定日期是该月第几周 Unit:DateUtils function NthDayOfWeek(const AValue: TDateTime): Word; Example: Uses SysUtils,DateUtils; Begin Write('Today is the ',NthDayOfWeek(Today),'-th '); Writeln(formatdateTime('dddd',Today),' of the month.');En…