博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MonthOfTheYear、WeekOfTheYear、WeekOfTheMonth、DayOfTheYear ... 相对时间
阅读量:6971 次
发布时间:2019-06-27

本文共 2573 字,大约阅读时间需要 8 分钟。

  hot3.png

SysUtils.DayOfWeek();DateUtils.MonthOfTheYear();DateUtils.WeekOfTheYear();DateUtils.WeekOfTheMonth();DateUtils.NthDayOfWeek();DateUtils.DayOfTheYear();DateUtils.DayOfTheMonth();DateUtils.DayOfTheWeek();DateUtils.SysUtils.DayOfWeek();DateUtils.HourOfTheYear();DateUtils.HourOfTheMonth();DateUtils.HourOfTheWeek();DateUtils.HourOfTheDay();DateUtils.MinuteOfTheYear();DateUtils.MinuteOfTheMonth();DateUtils.MinuteOfTheWeek();DateUtils.MinuteOfTheDay();DateUtils.MinuteOfTheHour();DateUtils.SecondOfTheYear();DateUtils.SecondOfTheMonth();DateUtils.SecondOfTheWeek();DateUtils.SecondOfTheDay();DateUtils.SecondOfTheHour();DateUtils.SecondOfTheMinute();DateUtils.MilliSecondOfTheYear();DateUtils.MilliSecondOfTheMonth();DateUtils.MilliSecondOfTheWeek();DateUtils.MilliSecondOfTheDay();DateUtils.MilliSecondOfTheHour();DateUtils.MilliSecondOfTheMinute();DateUtils.MilliSecondOfTheSecond();
unit Unit1;interfaceuses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs;type  TForm1 = class(TForm)    procedure FormCreate(Sender: TObject);  end;var  Form1: TForm1;implementation{$R *.dfm}uses DateUtils;procedure TForm1.FormCreate(Sender: TObject);var  t: TDateTime;  w: Word;  c: Cardinal;  i: Int64;begin  t := StrToDateTime('2009-5-20 11:22:33');  {指定时间是年度第几月份}  w := MonthOfTheYear(t);  //5  {指定时间分别是年、月的第几周}  w := WeekOfTheYear(t);  //21  w := WeekOfTheMonth(t); //3  w := NthDayOfWeek(t);   //3  {指定时间分别是年、月、周的第几天}  w := DayOfTheYear(t);   //140  w := DayOfTheMonth(t);  //20  w := DayOfTheWeek(t);   //3  w := SysUtils.DayOfWeek(t); //4; DayOfWeek 和 DayOfTheWeek 类似, 但算法不同  {指定时间分别是年、月、周、日的第几小时}  w := HourOfTheYear(t);  //3347  w := HourOfTheMonth(t); //467  w := HourOfTheWeek(t);  //59  w := HourOfTheDay(t);   //11  {指定时间分别是年、月、周、日、时的第几分钟}  c := MinuteOfTheYear(t);  //200842  w := MinuteOfTheMonth(t); //28042  w := MinuteOfTheWeek(t);  //3562  w := MinuteOfTheDay(t);   //682  w := MinuteOfTheHour(t);  //22  {指定时间分别是年、月、周、日、时、分的第几秒}  c := SecondOfTheYear(t);   //12050553  c := SecondOfTheMonth(t);  //1682553  c := SecondOfTheWeek(t);   //213753  c := SecondOfTheDay(t);    //40953  w := SecondOfTheHour(t);   //1353  w := SecondOfTheMinute(t); //33  {指定时间分别是年、月、周、日、时、分、秒的第几毫秒}  i := MilliSecondOfTheYear(t);   //12050553000  c := MilliSecondOfTheMonth(t);  //1682553000  c := MilliSecondOfTheWeek(t);   //213753000  c := MilliSecondOfTheDay(t);    //40953000  c := MilliSecondOfTheHour(t);   //1353000  c := MilliSecondOfTheMinute(t); //33000  w := MilliSecondOfTheSecond(t); //0end;end.


转载于:https://my.oschina.net/hermer/blog/320701

你可能感兴趣的文章
11-23网页基础--JavaScript基础知识
查看>>
python爬虫小结1
查看>>
BZOJ 2693 jzptab ——莫比乌斯反演
查看>>
自定义转场动画库
查看>>
《图像处理实例》 之 疏密程度统计
查看>>
归并排序(分治)
查看>>
mysql 添加索引语句
查看>>
bootstrap popover 如何在hover状态移动到弹出上不消失
查看>>
linux tmux 简单操作
查看>>
【状压dp】AC Challenge
查看>>
Oracle Install
查看>>
错误记录 "MongoClient opened before fork. Create MongoClient "
查看>>
第十二次作业
查看>>
第136天:Web前端面试题总结(理论)
查看>>
iOS开发-模板方法模式
查看>>
算法-最大连续子序列和
查看>>
NodeJS之Mac初体验
查看>>
勾股数
查看>>
zoj 1597 Circular Area
查看>>
v-solt插槽
查看>>