diff --git a/timeutils.nim b/timeutils.nim index 8d8674d..0fd8516 100644 --- a/timeutils.nim +++ b/timeutils.nim @@ -4,11 +4,14 @@ const zeroTime = fromUnix(0) const ISO_8601_FORMATS = @[ "yyyy-MM-dd'T'HH:mm:ssz", "yyyy-MM-dd'T'HH:mm:sszzz", - "yyyy-MM-dd'T'HH:mm:ss'.'fffzzz" + "yyyy-MM-dd'T'HH:mm:ss'.'fffzzz", + "yyyy-MM-dd HH:mm:ssz", + "yyyy-MM-dd HH:mm:sszzz", + "yyyy-MM-dd HH:mm:ss'.'fffzzz" ] proc format*(ti: TimeInterval, fmt: string): string = - let info = (fromUnix(0) + ti).utc + let info = (zeroTime + ti).utc return info.format(fmt) # Will be deprecated in Nim 0.18.1 as it will exist in the standard times module. diff --git a/timeutils.nimble b/timeutils.nimble index bf01b76..f1924c3 100644 --- a/timeutils.nimble +++ b/timeutils.nimble @@ -1,8 +1,8 @@ # Package -version = "0.5.0" +version = "0.5.1" author = "Jonathan Bernard" -description = "Utility methods to fill in the lacking time support in Nim\'s stdlib. This is holding me over until I can write a proper time module for the stdlib and submit it." +description = "Utility methods to fill in the lacking time support in Nim\'s stdlib." license = "BSD3" # Dependencies