delphi 中本年,本月,本周第一天和最后一天

来源:互联网 发布:淘宝兼职外宣说说内容 编辑:程序博客网 时间:2024/06/11 03:46
 
Delphi中本年、本月、本周第一天和最后一天uses DateUtils;function StartOfTheYear(const AValue: TDateTime): TDateTime;function EndOfTheYear(const AValue: TDateTime): TDateTime;function StartOfAYear(const AYear: Word): TDateTime;function EndOfAYear(const AYear: Word): TDateTime;function StartOfTheMonth(const AValue: TDateTime): TDateTime;function EndOfTheMonth(const AValue: TDateTime): TDateTime;function StartOfAMonth(const AYear, AMonth: Word): TDateTime;function EndOfAMonth(const AYear, AMonth: Word): TDateTime;function StartOfTheWeek(const AValue: TDateTime): TDateTime;           {ISO 8601}function EndOfTheWeek(const AValue: TDateTime): TDateTime;             {ISO 8601}function StartOfAWeek(const AYear, AWeekOfYear: Word;                  {ISO 8601}   const ADayOfWeek: Word = 1): TDateTime;function EndOfAWeek(const AYear, AWeekOfYear: Word;                    {ISO 8601}   const ADayOfWeek: Word = 7): TDateTime;

Delphi中本年、本月、本周第一天和最后一天

uses DateUtils;

function StartOfTheYear(const AValue: TDateTime): TDateTime;
function EndOfTheYear(const AValue: TDateTime): TDateTime;
function StartOfAYear(const AYear: Word): TDateTime;
function EndOfAYear(const AYear: Word): TDateTime;

function StartOfTheMonth(const AValue: TDateTime): TDateTime;
function EndOfTheMonth(const AValue: TDateTime): TDateTime;
function StartOfAMonth(const AYear, AMonth: Word): TDateTime;
function EndOfAMonth(const AYear, AMonth: Word): TDateTime;

function StartOfTheWeek(const AValue: TDateTime): TDateTime;           {ISO 8601}
function EndOfTheWeek(const AValue: TDateTime): TDateTime;             {ISO 8601}
function StartOfAWeek(const AYear, AWeekOfYear: Word;                  {ISO 8601}
   const ADayOfWeek: Word = 1): TDateTime;
function EndOfAWeek(const AYear, AWeekOfYear: Word;                    {ISO 8601}
   const ADayOfWeek: Word = 7): TDateTime;