Consider the below code
Instant instant = Instant.now();
System.out.println(instant);
RESULT:
2020-01-13T09:01:06.405Z
Now from the above result I want get the current hour and current minutes.
instant.atZone(ZoneOffset.UTC).getMinute() 
and
instant.atZone(ZoneOffset.UTC).getHour() 
(That's for UTC; otherwise choose your time zone).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With