set Open At
A UTC timeInMilliseconds contained within the month the calendar should openAt. Defaults to the month containing today if within bounds; otherwise, defaults to the starting month.
If you have access to java.time in Java 8, you can obtain a long using
java.time.ZonedDateTime
.
LocalDateTime local = LocalDateTime.of(year, month, 1, 0, 0);
local.atZone(ZoneId.ofOffset("UTC", ZoneOffset.UTC)).toInstant().toEpochMilli();
Content copied to clipboard
If you don't have access to java.time in Java 8, you can obtain this value using a
java.util.Calendar
instance from the UTC timezone.
Calendar c = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
c.set(year, month, 1);
c.getTimeInMillis();
Content copied to clipboard