LocalDateTime cannot represent a moment
One problem is your inappropriate use of the LocalDateTime class. That class purposely lacks the context of a time zone or office from UTC. So that class cannot represent a moment, a specific point on the timeline. Yet you are trying to track moments, apparently.
If handed a date and time only, parse as a LocalDateTime.
LocalDateTime ldt = LocalDateTime.parse( "2023-01-11T01:25:59" ) ;
OffsetDateTime
But if you are certain that date and time was meant to represent a moment as seen with an offset of zero, immediately convert to an OffsetDateTime. Meanwhile, educate the publisher of your input data about their failure to communicate all three pieces of vital info (date, time, and offset/zone).
OffsetDateTime odt = ldt.atOffset( ZoneOffset.UTC ) ;
The idea here is to “tell the truth”. If the intention is a date with time as seen in UTC, then our code should represent a date with time as seen in UTC.
Apparently you want to compare this date-time in UTC against the current moment as seen in UTC.
OffsetDateTime now = OffsetDateTime.now( ZoneOffset.UTC ) ;
LocalDate
Your primary concern is the date.
LocalDate shippingDate = odt.toLocalDate() ; LocalDate today = now.toLocalDate() ; LocalDate tomorrow = today.plusDays( 1 ) ; if ( shippingDate.isBefore( today ) { … is past } else if ( shippingDate.isEqual( today ) { … is today } else if ( shippingDate.isEqual( tomorrow ) { … is tomorrow } else if ( shippingDate.isAfter( tomorrow ) { … is future } else { … throw exception because we should never reach this point }
OffsetDateTime#getHour
Your secondary concern was apparently that you want to know, if today, is the target hour the same as the current hour. Your writing is not at all clear on this point, but that is my guess.
So add a nested test within the “is equal to today” test branch above.
if( odt.getHour() == now.getHour() ) { … same clock hour }
Or perhaps you want to test for a later, future hour.
if( odt.getHour() > now.getHour() ) { … later, future hour }
current.toLocalDate().plusDays(1).isEqual(shipping.toLocalDate())?shippingdate.isAfter(currentDateTime.plusHours(1)). I think. Also @SlawcompareTo()only tells you which date-time is after which one, not by how much.