Error when Using Time like 00:00:00 #11
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
In here
langfuse-java/src/main/java/com/langfuse/client/resources/sessions/SessionsClient.java
Lines 64 to 70 in 78b8673
| } | |
| if (request.getFromTimestamp().isPresent()) { | |
| QueryStringMapper.addQueryParameter(httpUrl, "fromTimestamp", request.getFromTimestamp().get().toString(), false); | |
| } | |
| if (request.getToTimestamp().isPresent()) { | |
| QueryStringMapper.addQueryParameter(httpUrl, "toTimestamp", request.getToTimestamp().get().toString(), false); | |
| } |
The Timestamp using OffsetDatetime::toString, when the time like: 1900-01-01T00:00:00.000
toString will get 1900-01-01T00:00 (shorter) which will make langfuse server return error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
Steffen911 commentedon Oct 27, 2025
@yangyaofei Do you have an intuitive idea on how this could be patched? Are there utility methods in Java that convert this to a valid ISO String?
yangyaofei commentedon Oct 27, 2025
@Steffen911 Use
DateTimeFormatterAnd if
2000-01-01T00:00+08:00still got error, use formatter likeoffsetDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX"))yangyaofei commentedon Oct 27, 2025
This is the doc for
toStirngfunction:So, all the format are ISO-8601 format.
There's some gap between python and java. 😂😂😂😂
ChoMinGi commentedon Aug 13, 2026
This looks fixed already. The linked code (
78b8673) called.toString()directly on theOffsetDateTimeforfromTimestamp/toTimestampquery params, which drops trailing zero seconds (1900-01-01T00:00Zinstead of...T00:00:00Z).That call was removed in
3805fa4(#20) — the value is now passed through Jackson instead, which serializes it correctly (1900-01-01T00:00:00Z). That commit is tagged inlangfuse-java-0.2.0, currently the latest release on Maven Central, so the fix is already published.Couldn't find the same
.toString()pattern anywhere else in the client. Should be safe to close unless someone can still repro on0.2.0.