Jonathan Lamothe on Nostr: Does time::OffsetDateTime::now_local() always fail in a testing context or something? ...
Does time::OffsetDateTime::now_local() always fail in a testing context or something? It keeps returning Err(IndeterminateOffset).
#rust
Edit: it's working fine when I use it in src/main.rs.
Published at
2024-04-18 19:45:21Event JSON
{
"id": "7ffd759e9a62b3b62b5a7da2d271f2a01cdbf3a45f4a66f2bf3f3deba8f51bb6",
"pubkey": "900d18b7d419807178b843cd37bc8f06b8eb5734299f78d257ffb6d5dc46e8f9",
"created_at": 1713469521,
"kind": 1,
"tags": [
[
"p",
"a829e38389e704710d5b5b780050e89aabb0bc130558739a2d84990762b39bcc",
"wss://relay.mostr.pub"
],
[
"t",
"rust"
],
[
"proxy",
"https://social.jlamothe.net/objects/c35d279b-5766-2178-5181-7c3691417301",
"activitypub"
]
],
"content": "Does time::OffsetDateTime::now_local() always fail in a testing context or something? It keeps returning Err(IndeterminateOffset).\n#rust\n\nEdit: it's working fine when I use it in src/main.rs.",
"sig": "83a206bf557ae5f7d2e19ebcecf34cd3283d4c26990f8020d99928092ed03605ea36d2da4ee0847a7d4e25342b4abd473085a972a4026c165decaeb0d971d685"
}