haskell / haskell/time

Functions to truncate time types

Open
#277 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
135
Forks
83
PR merge metrics
No merged PRs in 30d

Description

During tests I insert an entity in PostgreSQL (which has microsecond resolution) with a timestamp created with `time` (which has picosecond resolution). When I fetch the entity from the database, the timestamps obviously differ, because PostgreSQL has lower precision:

```diff
- expiration = Just 2025-08-22 11:59:23.370617513 UTC}]
+ expiration = Just 2025-08-22 11:59:23.370617 UTC}]
```

I have the option to tweak the record before handing it to the `assertEqual` funtion in my test suite. I was wondering if I could remove some precision from `UTCTime` in a principled way. Is that advised?

(btw, thank you @AshleyYakeley for your work on this library!)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.