diff options
Diffstat (limited to 'src/dbUtils.nim')
-rw-r--r-- | src/dbUtils.nim | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dbUtils.nim b/src/dbUtils.nim index bdbcf14..cfe54cf 100644 --- a/src/dbUtils.nim +++ b/src/dbUtils.nim @@ -1,13 +1,13 @@ import std/times import tiny_sqlite -proc toDbValue*(t: DateTime): DbValue {.raises: [].}= +proc toDbValue*(t: DateTime): DbValue {.raises: [].} = DbValue(kind: sqliteText, strVal: $t) -proc fromDbValue*(value: DbValue, T: typedesc[DateTime]): DateTime {.raises: [].}= - try: - case value.kind: - of sqliteText: return times.parse(value.strVal, "yyyy-MM-dd'T'HH:mm:sszzz") - else: return - except TimeParseError: - return +proc fromDbValue*(value: DbValue, T: typedesc[DateTime]): DateTime {.raises: [].} = + try: + case value.kind: + of sqliteText: return times.parse(value.strVal, "yyyy-MM-dd'T'HH:mm:sszzz") + else: return + except TimeParseError: + return |