Date Issue in the armhf Environment. #1420

Open
opened 2026-07-06 23:46:33 -04:00 by matoken · 0 comments
matoken commented 2026-07-06 23:46:33 -04:00 (Migrated from github.com)

In the armhf environment, the dates on Tweets appear incorrect.
This seems to be caused by using a 32-bit int, which results in an overflow.

For example, https://nitter.net/X/status/2073395918011789670#m shows:

Jul 4, 2026 · 1:18 PM UTC

but in an armhf environment, it becomes

Jan 7, 1970 · 5:17 AM UTC

Image

This seems to be caused by using a 32-bit int, which results in an overflow.

It seems to be working with the following patch, but I’m a beginner with Nim.

$ git diff
diff --git a/src/parser.nim b/src/parser.nim
index 0e45250..78ca266 100644
--- a/src/parser.nim
+++ b/src/parser.nim
@@ -502,7 +502,7 @@ proc parseGraphTweet(js: JsonNode): Tweet =
           "binding_values": %bindingObj
         }

-  var replyId = 0
+  var replyId: int64 = 0
   with restId, js{"reply_to_results", "rest_id"}:
     replyId = restId.getId

diff --git a/src/parserutils.nim b/src/parserutils.nim
index 8d6ea2e..63f400d 100644
--- a/src/parserutils.nim
+++ b/src/parserutils.nim
@@ -83,7 +83,7 @@ proc getTime*(js: JsonNode): DateTime =
   parseTime(js.getStr, "ddd MMM dd hh:mm:ss \'+0000\' yyyy", 30)

 proc getTimeFromMs*(js: JsonNode): DateTime =
-  let ms = js.getInt(0)
+  let ms = js.getBiggestInt(0)
   if ms == 0: return
   let seconds = ms div 1000
   return fromUnix(seconds).utc()
In the armhf environment, the dates on Tweets appear incorrect. This seems to be caused by using a 32-bit `int`, which results in an overflow. For example, https://nitter.net/X/status/2073395918011789670#m shows: > Jul 4, 2026 · 1:18 PM UTC but in an armhf environment, it becomes > Jan 7, 1970 · 5:17 AM UTC <img width="608" height="125" alt="Image" src="https://github.com/user-attachments/assets/6bd5612f-efc0-4897-a29f-d98b9d0b05d2" /> This seems to be caused by using a 32-bit int, which results in an overflow. It seems to be working with the following patch, but I’m a beginner with Nim. ``` $ git diff diff --git a/src/parser.nim b/src/parser.nim index 0e45250..78ca266 100644 --- a/src/parser.nim +++ b/src/parser.nim @@ -502,7 +502,7 @@ proc parseGraphTweet(js: JsonNode): Tweet = "binding_values": %bindingObj } - var replyId = 0 + var replyId: int64 = 0 with restId, js{"reply_to_results", "rest_id"}: replyId = restId.getId diff --git a/src/parserutils.nim b/src/parserutils.nim index 8d6ea2e..63f400d 100644 --- a/src/parserutils.nim +++ b/src/parserutils.nim @@ -83,7 +83,7 @@ proc getTime*(js: JsonNode): DateTime = parseTime(js.getStr, "ddd MMM dd hh:mm:ss \'+0000\' yyyy", 30) proc getTimeFromMs*(js: JsonNode): DateTime = - let ms = js.getInt(0) + let ms = js.getBiggestInt(0) if ms == 0: return let seconds = ms div 1000 return fromUnix(seconds).utc() ```
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
PAS/nitter#1420
No description provided.