Skip to content

Release 1.1.0

Choose a tag to compare

@guobinhit guobinhit released this 21 Sep 09:58
· 3 commits to main since this release

Supply a time toolkit names timekit. Using timekit, you can get some pratical functions.

Basic

  • add times with days, such as GetTimeAddDays, if param of d is 2022-04-13 10:20:30, then GetTimeAddDays(5) return 2022-04-18 10:20:30.
  • add times with hours, such as GetTimeAddHorus, if param of d is 2022-04-13 10:20:30, then GetTimeAddHorus(5) return 2022-04-13 15:20:30.
  • Similarly, if we set params is negative, the result is to subtract the corresponding time.

Format

  • format a time value to string, such as FormatYyyyMmDdHhMmSs, if param of d is 2022-04-13 10:20:30, then FormatYyyyMmDdHhMmSs(d) return 2022-04-13 10:20:30.
  • format a time value to string, such as FormatCnYyyyMmDdHhMmSs, if param of d is 2022-04-13 10:20:30, then FormatCnYyyyMmDdHhMmSs(d) return 2022年04月13日 10:20:30.
  • format a time value to string, such as FormatEnYyyyMmDdHhMmSs, if param of d is 2022-04-13 10:20:30, then FormatEnYyyyMmDdHhMmSs(d) return 2022/04/13 10:00:00.
  • format a time value to string, such as FormatCptYyyyMmDdHhMmSs, if param of d is 2022-04-13 10:20:30, then FormatCptYyyyMmDdHhMmSs(d) return 20220413102030.

Parse

  • parse a string value to time, such as ParseYyyyMmDdHhMmSs, if param of d is 2022-04-13 10:20:30, then ParseYyyyMmDdHhMmSs(d) return 2022-04-13 10:20:30.
  • parse a string value to time, such as ParseCnYyyyMmDdHhMmSs, if param of d is 2022年04月13日 10:20:30, then ParseCnYyyyMmDdHhMmSs(d) return 2022-04-13 10:20:30.
  • parse a string value to time, such as ParseEnYyyyMmDdHhMmSs, if param of d is 2022/04/13 10:00:00, then ParseEnYyyyMmDdHhMmSs(d) return 2022-04-13 10:20:30.
  • parse a string value to time, such as ParseCptYyyyMmDdHhMmSs, if param of d is 20220413102030, then ParseCptYyyyMmDdHhMmSs(d) return 2022-04-13 10:20:30.