#Date time is wrong?

1 messages · Page 1 of 1 (latest)

maiden raven
#
Utils.LOGGER.error(String.valueOf(date.getTime()));
Utils.LOGGER.error(date.toString());
Utils.LOGGER.error(Instant.ofEpochSecond(date.getTime()).toString());

above prints:
1717249769326
Sat Jun 01 16:49:29 EEST 2024
+56387-06-25T00:48:46Z
I don't understand why making an Instant or a new Date based off getTime() gives such a weird year, hour, etc

primal coyoteBOT
#

<@&987246399047479336> please have a look, thanks.

maiden raven
#

Ok so uhh

Utils.LOGGER.error(String.valueOf(Instant.ofEpochSecond(date.getTime()).getEpochSecond()));
Utils.LOGGER.error(String.valueOf(Date.from(Instant.ofEpochSecond(date.getTime())).getTime()));

This prints
1717249769326
1717249769326000

#

ig .getTime() contains the ms

mortal hinge
#

Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.

maiden raven
#

aha

#

I'll close the thread then