3 ms·
> Store it as Unix epoch seconds This is what we do. Have been storing 100% of our timestamps this way in SQLite for ~8 years now. Using .NET to handle the act
by bob1029 4y ago
> Store it as Unix epoch seconds
This is what we do. Have been storing 100% of our timestamps this way in SQLite for ~8 years now. Using .NET to handle the actual conversion to/from long.
var myTimeUtc = DateTime.UtcNow;
var myTimeUnix = new DateTimeOffset(myTimeUtc).ToUnixTimeSeconds();
var myTimeUtc2 = DateTimeOffset.FromUnixTimeSeconds(myTimeUnix).UtcDateTime;
No drama at all. No weird libraries or utility methods. It's all simple built-ins these days.
- torbica 4y agoAre you maybe hiring? I have been reading you posts last couple years on HN. I am doing something very similar with .NET stack (single file deployments), SQLite and offline scenario... Please contact me on my username's email (gmail).