Here you can find the source of getThisMonthBeginInstant()
public static Instant getThisMonthBeginInstant()
//package com.java2s; //License from project: Open Source License import java.time.*; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalAdjusters; public class Main { public static Instant getThisMonthBeginInstant() { LocalDateTime localDate = LocalDateTime.now().withSecond(0) .withHour(0).withMinute(0) .with(TemporalAdjusters.firstDayOfMonth()) .truncatedTo(ChronoUnit.SECONDS); return localDate.toInstant(ZoneOffset.UTC); }//from w w w. j a v a2 s. c o m }