Java Date Time Java Java API
java.time.ZonedDateTime
public ZonedDateTime withMinute(int minute)
Returns a copy of this ZonedDateTime with minute-of-hour replaced with the provided 'minute'
package com.logicbig.example.zoneddatetime;import java.time.ZoneId;import java.time.ZonedDateTime;public class WithMinuteExample { public static void main(String... args) { ZonedDateTime d = ZonedDateTime.of(2017, 2, 12, 20, 33, 23, 2000, ZoneId.systemDefault()); System.out.println(d); ZonedDateTime d2 = d.withMinute(0); System.out.println(d2); }}
2017-02-12T20:33:23.000002-06:00[America/Chicago]2017-02-12T20:00:23.000002-06:00[America/Chicago]