My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
DateAndTimeComponents  
Financial Toolbox / Dates / Date and Time Components.
Updated Oct 30, 2011 by youli...@chaoskey.com

Date and Time Components(基本的日期/时间函数)

约定:时间的3种格式

  • 字符串格式: "2011-09-29 09:16:09"(目前只支持这一种时间字符串,也可以是其子串)
  • List格式: [2011,9,29,9,16,9]
  • Number格式: 734775.3862152778(距离0000年1月1号的实际天数)

函数列表

  1. 是否是闰年
  2. is_leap_year(year);
  3. 指定年闭区间的闰年数
  4. leap_years(year1,year2);
  5. 绝对天数(the number of days since January 1,0000)
  6. days:absolute_daysact(year,month,day);
    [year,month,day]:absolute_daysact(days);
  7. 将时间转换成Number格式(Create date number)
  8. datenum(dt);
  9. 将时间转换成List格式(Create date list)
  10. datelist(dt);
  11. 将时间转换成字符串格式(Create date string)
  12. datestr(dt);
  13. 指定的日期是星期几?(Day of week)
  14. weekday(year,month,day);
  15. 指定年月的最后一天(Last day of month)
  16. eomday(dt);
    eomday(year,month);
  17. 指定年月的最后一天(Last date of month)
  18. eomdate(dt);
    eomdate(year,month);
  19. 两个日期的完整间隔月数(Number of whole months between dates)
  20. months(start_date,end_date<,end_month_flag>);

混沌 <youliang@chaoskey.com>

http://blog.chaoskey.com


Sign in to add a comment
Powered by Google Project Hosting