Skip to content

Error when Using Time like 00:00:00 #11

Open

Description

@yangyaofei

In here

}
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.

Activity

  1. Steffen911 commented on Oct 27, 2025

    @Steffen911
    Member

    @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?

  2. self-assigned this
    on Oct 27, 2025
  3. yangyaofei commented on Oct 27, 2025

    @yangyaofei
    Author

    @Steffen911 Use DateTimeFormatter

    public static void main(String[] args) {
        OffsetDateTime odt = OffsetDateTime.of(2000, 1, 1, 0, 0, 0, 0, ZoneOffset.ofHours(8));
        String isoString = odt.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
        System.out.println(isoString);
        System.out.println(odt.toString());
    }
    2000-01-01T00:00:00+08:00
    2000-01-01T00:00+08:00
    

    And if 2000-01-01T00:00+08:00 still got error, use formatter like offsetDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX"))

  4. yangyaofei commented on Oct 27, 2025

    @yangyaofei
    Author

    This is the doc for toStirng function:

    Outputs this date-time as a String, such as 2007-12-03T10:15:30+01:00.
    The output will be one of the following ISO-8601 formats:
    uuuu-MM-dd'T'HH:mmXXXXX
    uuuu-MM-dd'T'HH:mm:ssXXXXX
    uuuu-MM-dd'T'HH:mm:ss.SSSXXXXX
    uuuu-MM-dd'T'HH:mm:ss.SSSSSSXXXXX
    uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSSXXXXX
    The format used will be the shortest that outputs the full value of the time where the omitted parts are implied to be zero.
    

    So, all the format are ISO-8601 format.

    There's some gap between python and java. 😂😂😂😂

  5. ChoMinGi commented on Aug 13, 2026

    @ChoMinGi
    Contributor

    This looks fixed already. The linked code (78b8673) called .toString() directly on the OffsetDateTime for fromTimestamp/toTimestamp query params, which drops trailing zero seconds (1900-01-01T00:00Z instead 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 in langfuse-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 on 0.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions