TAI time from String with date time representation

92 Views Asked by At

In my Java task I get some timestamps in Strings in the format of: YYYY-MM-ddTHH:mm:ss.S. These timestamps are supposed to be interpreted as TAI time (International atomic time).

I need to compare these timestamps to others, some of which might be UTC times. Therefore I want to convert the TAI times to UTC times (or UNIX time). Now my problem is, that I can't find an option which allows me to parse the timestamp Strings without interpreting the (TAI) time in a wrong timescale.

For example using the standard LocalDateTime would interprete the timestamp as time including leap seconds, if I understood it correctly. Now I could try adding the seconds via an ZoneOffset, but I don't know how I would calculate these without already knowing/ having the correct date and time in either timescale.

I also looked at ThreeTen-Extra, which supports TAI time, but here they only allow parsing from TAI seconds. I am not able to change the input format to get the representation as TAI seconds.

How should I go forward from this?

0

There are 0 best solutions below