public static Instant getMonthStart ( Instant time ) { Assert . notNull ( time , "Missing date time" ) ; LocalDateTime dateTime = LocalDateTime . ofInstant ( time , ZoneOffset . UTC ) ; dateTime = dateTime . withDayOfMonth ( 1 ) . withHour ( 0 ) . withMinute ( 0 ) . withSecond ( 0 ) . with ( ChronoField . MILLI_OF_SECOND , 0 ) ; return dateTime . toInstant ( ZoneOffset . UTC ) ; }
Gets first millisecond of first day in month