亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標題: erlang好用日期模塊 [打印本頁]

作者: shijiang1130    時間: 2016-05-23 09:33
標題: erlang好用日期模塊
https://github.com/choptastic/qdate

作者: shijiang1130    時間: 2016-05-23 09:33
  1. Date Arithmetic from "now"

  2. There are 7 other arithmetic functions that take a single argument, and these do arithmetic from "now." For example, add_years(4) is a shortcut for add_years(4, os:timestamp()).

  3. add_seconds(Seconds)
  4. add_minutes(Minutes)
  5. add_hours(Hours)
  6. add_days(Days)
  7. add_weeks(Weeks)
  8. add_months(Months)
  9. add_years(Years)
  10. Date and Time Ranges

  11. qdate provides a number of range functions that give applicable dates/times within a start and end time. For example, "All days from 2015-01-01 to today", "every 3rd month from 2000-01-01 to 2009-12-31", or "every 15 minutes from midnight to 11:59pm on 2015-04-15".

  12. The functions are as follows:

  13. range_seconds(Interval, Start, End)
  14. range_minutes(Interval, Start, End)
  15. range_hours(Interval, Start, End)
  16. range_days(Interval, Start, End)
  17. range_weeks(Interval, Start, End)
  18. range_months(Interval, Start, End)
  19. range_years(Interval, Start, End)
  20. Where Interval is the number of seconds/days/years/etc.

  21. So for example:

  22. %% Get every 15th minute from "2015-04-15 12:00am to 2015-04-15 11:59am"
  23. > qdate:range_minutes(15, "2015-04-15 12:00am", "2015-04-15 11:59am").
  24. [1429056000,1429056900,1429057800,1429058700,1429059600,
  25. 1429060500,1429061400,1429062300,1429063200,1429064100,
  26. 1429065000,1429065900,1429066800,1429067700,1429068600,
  27. 1429069500,1429070400,1429071300,1429072200,1429073100,
  28. 1429074000,1429074900,1429075800,1429076700,1429077600,
  29. 1429078500,1429079400,1429080300,1429081200|...]

  30. %% Get every day of April, 2014
  31. > qdate:range_days(1, "2014-04-01", "2014-04-30").
  32. [1396310400,1396396800,1396483200,1396569600,1396656000,
  33. 1396742400,1396828800,1396915200,1397001600,1397088000,
  34. 1397174400,1397260800,1397347200,1397433600,1397520000,
  35. 1397606400,1397692800,1397779200,1397865600,1397952000,
  36. 1398038400,1398124800,1398211200,1398297600,1398384000,
  37. 1398470400,1398556800,1398643200,1398729600|...]
復制代碼

作者: patagonia2    時間: 2016-05-23 13:15
學了Er之后,我就想Er 真的很好!
為什么?
Er對初學者很友好,好多非常好用的一些模塊
[fly][/fly]





歡迎光臨 Chinaunix (http://72891.cn/) Powered by Discuz! X3.2