Perl时间处理函数
官方网址:http://search.cpan.org/~stbey/Date-Calc-6.3/lib/Date/Calc.pod#___top use Date::Calc qw(
Days_in_Year
Days_in_Month
Weeks_in_Year
leap_year
check_date
check_time
check_business_date
Day_of_Year
Date_to_Days
Day_of_Week
Week_Number
Week_of_Year
Monday_of_Week
Nth_Weekday_of_Month_Year
Standard_to_Business
Business_to_Standard
Delta_Days
Delta_DHMS
Delta_YMD
Delta_YMDHMS
N_Delta_YMD
N_Delta_YMDHMS
Normalize_DHMS
Add_Delta_Days
Add_Delta_DHMS
Add_Delta_YM
Add_Delta_YMD
Add_Delta_YMDHMS
Add_N_Delta_YMD
Add_N_Delta_YMDHMS
System_Clock
Today
Now
Today_and_Now
This_Year
Gmtime
Localtime
Mktime
Timezone
Date_to_Time
Time_to_Date
Easter_Sunday
Decode_Month
Decode_Day_of_Week
Decode_Language
Decode_Date_EU
Decode_Date_US
Fixed_Window
Moving_Window
Compress
Uncompress
check_compressed
Compressed_to_Text
Date_to_Text
Date_to_Text_Long
English_Ordinal
Calendar
Month_to_Text
Day_of_Week_to_Text
Day_of_Week_Abbreviation
Language_to_Text
Language
Languages
Decode_Date_EU2
Decode_Date_US2
Parse_Date
ISO_LC
ISO_UC
); use Date::Calc qw(:all); Days_in_Year
$days = Days_in_Year($year,$month); Days_in_Month
$days = Days_in_Month($year,$month); Weeks_in_Year
$weeks = Weeks_in_Year($year); leap_year
if (leap_year($year)) check_date
if (check_date($year,$month,$day)) check_time
if (check_time($hour,$min,$sec)) check_business_date
if (check_business_date($year,$week,$dow)) Day_of_Year
$doy = Day_of_Year($year,$month,$day); Date_to_Days
$days = Date_to_Days($year,$month,$day); Day_of_Week
$dow = Day_of_Week($year,$month,$day); Week_Number
$week = Week_Number($year,$month,$day); # DEPRECATED Week_of_Year
($week,$year) = Week_of_Year($year,$month,$day); # RECOMMENDED
$week = Week_of_Year($year,$month,$day); # DANGEROUS Monday_of_Week
($year,$month,$day) = Monday_of_Week($week,$year); Nth_Weekday_of_Month_Year
if (($year,$month,$day) =
Nth_Weekday_of_Month_Year($year,$month,$dow,$n)) Standard_to_Business
($year,$week,$dow) =
Standard_to_Business($year,$month,$day); Business_to_Standard
($year,$month,$day) =
Business_to_Standard($year,$week,$dow); Delta_Days
$Dd = Delta_Days($year1,$month1,$day1,
$year2,$month2,$day2); Delta_DHMS
($Dd,$Dh,$Dm,$Ds) =
Delta_DHMS($year1,$month1,$day1, $hour1,$min1,$sec1,
$year2,$month2,$day2, $hour2,$min2,$sec2); Delta_YMD
($Dy,$Dm,$Dd) =
Delta_YMD($year1,$month1,$day1,
$year2,$month2,$day2); Delta_YMDHMS
($D_y,$D_m,$D_d, $Dh,$Dm,$Ds) =
Delta_YMDHMS($year1,$month1,$day1, $hour1,$min1,$sec1,
$year2,$month2,$day2, $hour2,$min2,$sec2); N_Delta_YMD
($Dy,$Dm,$Dd) =
N_Delta_YMD($year1,$month1,$day1,
$year2,$month2,$day2); N_Delta_YMDHMS
($D_y,$D_m,$D_d, $Dhh,$Dmm,$Dss) =
N_Delta_YMDHMS($year1,$month1,$day1, $hour1,$min1,$sec1,
$year2,$month2,$day2, $hour2,$min2,$sec2); Normalize_DHMS
($Dd,$Dh,$Dm,$Ds) =
Normalize_DHMS($Dd,$Dh,$Dm,$Ds); Add_Delta_Days
($year,$month,$day) =
Add_Delta_Days($year,$month,$day,
$Dd); Add_Delta_DHMS
($year,$month,$day, $hour,$min,$sec) =
Add_Delta_DHMS($year,$month,$day, $hour,$min,$sec,
$Dd,$Dh,$Dm,$Ds); Add_Delta_YM
($year,$month,$day) =
Add_Delta_YM($year,$month,$day,
$Dy,$Dm); Add_Delta_YMD
($year,$month,$day) =
Add_Delta_YMD($year,$month,$day,
$Dy,$Dm,$Dd); Add_Delta_YMDHMS
($year,$month,$day, $hour,$min,$sec) =
Add_Delta_YMDHMS($year,$month,$day, $hour,$min,$sec,
$D_y,$D_m,$D_d, $Dh,$Dm,$Ds); Add_N_Delta_YMD
($year,$month,$day) =
Add_N_Delta_YMD($year,$month,$day,
$Dy,$Dm,$Dd); Add_N_Delta_YMDHMS
($year,$month,$day, $hour,$min,$sec) =
Add_N_Delta_YMDHMS($year,$month,$day, $hour,$min,$sec,
$D_y,$D_m,$D_d, $Dhh,$Dmm,$Dss); System_Clock
($year,$month,$day, $hour,$min,$sec, $doy,$dow,$dst) =
System_Clock([$gmt]); Today
($year,$month,$day) = Today([$gmt]); Now
($hour,$min,$sec) = Now([$gmt]); Today_and_Now
($year,$month,$day, $hour,$min,$sec) = Today_and_Now([$gmt]); This_Year
$year = This_Year([$gmt]); Gmtime
($year,$month,$day, $hour,$min,$sec, $doy,$dow,$dst) =
Gmtime([time]); Localtime
($year,$month,$day, $hour,$min,$sec, $doy,$dow,$dst) =
Localtime([time]); Mktime
$time = Mktime($year,$month,$day, $hour,$min,$sec); Timezone
($D_y,$D_m,$D_d, $Dh,$Dm,$Ds, $dst) = Timezone([time]); Date_to_Time
$time = Date_to_Time($year,$month,$day, $hour,$min,$sec); Time_to_Date
($year,$month,$day, $hour,$min,$sec) = Time_to_Date([time]); Easter_Sunday
($year,$month,$day) = Easter_Sunday($year); Decode_Month
if ($month = Decode_Month($string[,$lang])) Decode_Day_of_Week
if ($dow = Decode_Day_of_Week($string[,$lang])) Decode_Language
if ($lang = Decode_Language($string)) Decode_Date_EU
if (($year,$month,$day) = Decode_Date_EU($string[,$lang])) Decode_Date_US
if (($year,$month,$day) = Decode_Date_US($string[,$lang])) Fixed_Window
$year = Fixed_Window($yy); Moving_Window
$year = Moving_Window($yy); Compress
$date = Compress($year,$month,$day); Uncompress
if (($century,$year,$month,$day) = Uncompress($date)) check_compressed
if (check_compressed($date)) Compressed_to_Text
$string = Compressed_to_Text($date[,$lang]); Date_to_Text
$string = Date_to_Text($year,$month,$day[,$lang]); Date_to_Text_Long
$string = Date_to_Text_Long($year,$month,$day[,$lang]); English_Ordinal
$string = English_Ordinal($number); Calendar
$string = Calendar($year,$month[,$orthodox[,$lang]]); Month_to_Text
$string = Month_to_Text($month[,$lang]); Day_of_Week_to_Text
$string = Day_of_Week_to_Text($dow[,$lang]); Day_of_Week_Abbreviation
$string = Day_of_Week_Abbreviation($dow[,$lang]); Language_to_Text
$string = Language_to_Text($lang); Language
$lang = Language();
Language($lang); # DEPRECATED
$oldlang = Language($newlang); # DEPRECATED Languages
$max_lang = Languages(); Decode_Date_EU2
if (($year,$month,$day) = Decode_Date_EU2($string[,$lang])) Decode_Date_US2
if (($year,$month,$day) = Decode_Date_US2($string[,$lang])) Parse_Date
if (($year,$month,$day) = Parse_Date($string[,$lang])) ISO_LC
$lower = ISO_LC($string); ISO_UC
$upper = ISO_UC($string); Version
$string = Date::Calc::Version();
Perl时间处理函数的更多相关文章
- MySQL 日期、时间转换函数
MySQL 日期.时间转换函数:date_format(date,format), time_format(time,format) 能够把一个日期/时间转换成各种各样的字符串格式.它是 str_to ...
- PHP的日期和时间处理函数
1. 将日期和时间转变为时间戳 1.1 time() 原型:time(void) 作用:返回当前时间的 UNIX时间戳. 参数:void,可选(即无参数) 1.2 mktime() 原型:int mk ...
- μC/OS-Ⅲ系统的时间管理函数和定时器
一.时间管理函数 μC/OS-Ⅲ系统提供一些列时间管理服务函数: 1.OSTimeDly():任务延时n个时钟节拍. 2.OSTimeDlyHMSM():任务延时指定的时间,采用“时:分:秒:毫秒”方 ...
- SQL-数学、字符串、时间日期函数和类型转换
--数学函数 --ABS绝对值,select ABS(-99)--ceiling取上限,select CEILING(4.5)--floor去下限select FLOOR(4.5)--power 几次 ...
- SQLite中的时间日期函数(转)
SQLite包含了如下时间/日期函数: datetime().......................产生日期和时间date()...........................产生日期tim ...
- SAP 使用较频繁的日期时间处理函数总结
在ABAP实际开发中,经常需要用到一些日期时间处理函数,个人感觉经常使用到的函数进行一下汇总 1. 根据工厂日历 计划交货日期 和 收货处理时间 来计算 销售计划中计划完工日期,其他类似日期计算等 ...
- MySQL 获得当前日期时间\时间戳 函数 ( 转自传智播客)
MySQL 获得当前日期时间 函数 1.1 获得当前日期+时间(date + time)函数:now() mysql> select now(); +-------+ | now() | +-- ...
- PostgreSQL的时间/日期函数使用
PostgreSQL的常用时间函数使用整理如下: 一.获取系统时间函数 1.1 获取当前完整时间 select now(); david=# select now(); now ----------- ...
- SQL servcer 时间日期函数、数据类型转换
1.时间日期函数 2.数据类型转换 3.习题 建立两个表,一个部门表,一个人员表.部门:部门的编号,部门的名称,部门的职责.人员:人员的编号,姓名,年龄,性别,cid所属部门
随机推荐
- Effective C++ 总结(三)
五.实现 条款26:尽可能延后变量定义式的出现时间 如果你定义了一个变量且该类型带一个构造函数或析构函数,当程序到达该变量时,你要承受构造成本,而离开作用域时,你要承受析构成本.为了减少这个成本,最 ...
- iOS开发UI篇-懒加载、重写setter方法赋值
一.懒加载 1.懒加载定义 懒加载——也称为延迟加载,即在需要的时候才加载(效率低,占用内存小).所谓懒加载,写的是其get方法. 注意:如果是懒加载的话则一定要注意先判断是否已经有了,如果没有那么再 ...
- Android开发艺术探索》读书笔记 (12) 第12章 Bitmap的加载和Cache
第12章 Bitmap的加载和Cache 12.1 Bitmap的高速加载 (1)Bitmap是如何加载的?BitmapFactory类提供了四类方法:decodeFile.decodeResourc ...
- Android(java)学习笔记243:多媒体之视频播放器
1.这里我们还是利用案例演示视频播放器的使用: (1)首先,我们看看布局文件activity_main.xml,如下: <RelativeLayout xmlns:android="h ...
- ansible小结
一.Ansible的安装 1.yum源安装 以centos为例,默认在源里没有ansible,不过在fedora epel源里有ansible,配置完epel 源后,可以直接通过yum 进行安装.这里 ...
- Android的GridView和Gallery结合Demo
Android的GridView和Gallery结合Demo Demo介绍:首页是一个GridView加载图片,竖屏时显示3列图片,横屏时显示4列图片;并且对图片进行大小限制和加灰色边框处理. 点击某 ...
- js原生封装自定义滚动条
/* * @Author: dothin前端 * @Date: 2015-11-21 00:12:15 * @Last Modified by: dothin前端 * @Last Modified t ...
- Asp.net 主题 【1】
页面中默认的显示样式太朴素,一页一页的设置控件的显示样式效率又太低,主题和皮肤则提供了一种高效的设计方案. 一.添加主题 二.添加皮肤文件(.skin): 在皮肤文件中添加如下代码 <asp ...
- spring web flow 2.0入门(转)
Spring Web Flow 2.0 入门 一.Spring Web Flow 入门demo(一)简单页面跳转 附源码(转) 二.Spring Web Flow 入门demo(二)与业务结合 附源码 ...
- Mysql 数据类型使用说明
FLOAT 和DOUBLE 类型支持使用标准的浮点运算进行近似计算. DECIMAL类型用于存储精确的小数. 因为cpu不支持对DECIMAL的直接计算,所以在Mysql5.0及更高的版本中,MYSQ ...