Skip to content

sql-timestamp fails on long, expecting int #10

Closed

Description

@rplevy

sql-timestamp now fails on trying to convert a long to an integer:
e.g. (time/sql-timestamp 1498582624546) results in Value out of range for int: 1498582624546

In a previous version, 0.2.2, the expected behavior for longs was in place, but it was lost when I upgrade to 0.3.0. The actual regression may have been introduced in an earlier version, that is just the version I upgraded to as it is presently the latest release.

Activity

  1. dm3 commented on Jun 27, 2017

    @dm3
    Owner

    @rplevy - sorry, seems I've changed to-sql-timestamp as well as to-sql-date but didn't mention the former one in the breaking changes for 0.3.0.

    You can still get a sql-timestamp out of an epoch millis by doing:

    (j/sql-timestamp (j/local-date-time (j/instant 1498582624546) (j/zone-id))))

    Be aware that sql-timestamp uses java.sql.Timestamp/valueOf which will use the default timezone of the JVM to remove the offset, hence the (j/zone-id) above.

    I'll think on how to allow going from Instant -> sql.Timestamp.

    EDIT: mentioned the breaking change in the CHANGELOG

  2. self-assigned this
    on Jun 27, 2017
  3. added this to the 0.3.1 milestone on Jun 27, 2017
  4. modified the milestones: 0.3.2, 0.3.1 on Aug 16, 2017
  5. dm3 commented on Dec 27, 2017

    @dm3
    Owner

    Added instant->sql-timestamp to construct a java.sql.Timestamp out of an instant/long.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions