Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/db/serializable.cr
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,15 @@ module DB
end
end
end

module Time::EpochConverter
def self.from_rs(rs : ::DB::ResultSet) : Time
Time.unix(rs.read.as(Int64)) # This is probably not correct for DBs other than SQLite.
end
end

module Time::EpochMillisConverter
def self.from_rs(rs : ::DB::ResultSet) : Time
Time.unix_ms(rs.read.as(Int64)) # This is probably not correct for DBs other than SQLite.
end
end
Loading