Java Date Time Java Java API
java.time.LocalTime
public OffsetTime atOffset(ZoneOffset offset)
Combines this time fields with the provided ZoneOffset to create a new instance of OffsetTime.
package com.logicbig.example.localtime;import java.time.*;public class AtOffsetExample { public static void main (String... args) { LocalTime d = LocalTime.of(13, 10, 20); OffsetTime d2 = d.atOffset(ZoneOffset.of("-6")); System.out.println(d2); }}
13:10:20-06:00