zoukankan      html  css  js  c++  java
  • Delphi 学习之函数 ②扩展的日期时间操作函数

    //▎============================================================▎//
    //▎================② 扩展的日期时间操作函数  =================▎//
    //▎============================================================▎//
    
    function GetYear(Date: TDate): Integer;   {测试通过}
    {* 取日期年份分量}
    function GetMonth(Date: TDate): Integer;   {测试通过}
    {* 取日期月份分量}
    function GetDay(Date: TDate): Integer;   {测试通过}
    {* 取日期天数分量}
    function GetHour(Time: TTime): Integer;   {测试通过}
    {* 取时间小时分量}
    function GetMinute(Time: TTime): Integer;   {测试通过}
    {* 取时间分钟分量}
    function GetSecond(Time: TTime): Integer;   {测试通过}
    {* 取时间秒分量}
    function GetMSecond(Time: TTime): Integer;   {测试通过}
    {* 取时间毫秒分量}
    function GetMonthLastDay(Cs_Year,Cs_Month:string):string;
    { *传入年、月,得到该月份最后一天}
    function IsLeapYear( nYear: Integer ): Boolean;
    {*/判断某年是否为闰年}
    function MaxDateTime(const Values: array of TDateTime): TDateTime;
    {//两个日期取较大的日期}
    function MinDateTime(const Values: array of TDateTime): TDateTime;
    {//两个日期取较小的日期}
    function dateBeginOfMonth(D: TDateTime): TDateTime;
    {//得到本月的第一天}
    function DateEndOfMonth(D: TDateTime): TDateTime;
    {//得到本月的最后一天}
    function DateEndOfYear(D: TDateTime): TDateTime;
    {//得到本年的最后一天}
    function DaysBetween(Date1, Date2: TDateTime): integer;
    {//得到两个日期相隔的天数}
  • 相关阅读:
    JSON开源库API【转载】https://nlohmann.github.io/json/index.html
    ZeroMQ示例(C/C++/PHP)详解三种模式
    Makefile精髓篇【转】
    JNI数组操作
    【摘要】malloc、calloc和realloc的用法
    容器内部安装scp,拷贝到外部物理机
    关于VMware虚拟机安装镜像时黑屏的解决办法
    linux下打压缩解压
    高效载入“大”图片
    后台执行Bitmap加载
  • 原文地址:https://www.cnblogs.com/flay/p/2460101.html
Copyright © 2011-2022 走看看