erlang各种有用的函数包括一些有用nif封装,还有一些性能测试case。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

21 lines
938 B

-define(SECS_MIN, 60). %% 一分钟的秒数
-define(SECS_HOUR, 3600). %% 一小时的秒数
-define(SECS_DAY, 86400). %% 一天的时间(秒)
-define(SECS_WEEK, 604800). %% 一周的时间(秒)
-define(DAYS_NO_LEAP_YEAR, 365). %% 平年天数
-define(DAYS_LEAP_YEAR, 366). %% 闰年天数
-define(SECS_1970, 62167219200). %% utc 1970年经历过的秒数
-type year() :: non_neg_integer().
-type month() :: 1..12.
-type day() :: 1..31.
-type hour() :: 0..23.
-type minute() :: 0..59.
-type second() :: 0..59.
-type date() :: {year(), month(), day()}.
-type time() :: {hour(), minute(), second()}.
-type datetime() :: {date(), time()}.
-type timestamp() :: non_neg_integer(). %% 时间戳
-type week() :: 1..7.
-type weekCycle() :: 1..53. %% 一年最多53个周
-type yearWeekCycle() :: {year(), weekCycle()}.