I get this error whenever I try to remove the decimal point of the Instant datatype in java.
! java.util.IllegalFormatConversionException: M != java.time.Instant
Here is the line of code I am trying to use for the conversion. I am using String.format
subCategory.setSla(Instant.parse(String.format("%tM", Instant.ofEpochSecond(dto.getSla().atZone(ZoneOffset.UTC).getMinute()))));
Without the string format, I get something like 24.00000
I don't want to see the decimal points after 24, how best do you think, it can be handled?
My dto has something like
private Instant sla;
My dto is returning an Instant
, that I am very sure of. I want to display just the minute and send just the minute to users in an email. I don't want the default representation with decimal point.