Algorithm to create X number of dates

Currently I have a list of Strings that represent a date in a yyyyMM format, something like this: 202008 202009 202010 I need to create x number of entries in this list with each entry increasing …

Java: Order a list of Objects based on Calendar date?

I have a list of Java Objects that all contain the following field: @JsonProperty @Column(name = “date”) private Calendar date; I want to order the list of objects based on the above field , the …

Java Calendar not giving end of hour

Based on Epoch seconds, I convert it to the start of hour and end of hour. long epochSeconds = 1589374800L; Instant instant = Instant.ofEpochSecond(epochSeconds); Calendar now = Calendar….

Can I add seconds to current date without using Calendar Library in Java?

I want to get the current time in Java, and now I want to add 15 seconds above the time. Can I do this with a library other than the Calendar library in java? import java.util.Calendar; public …

Kotlin (null cannot be cast to non-null type) Custom Calendar Implementation

I am trying to use the library https://github.com/kizitonwose/CalendarView (which was made in Kotlin) in Java. In this library there is an example to select a date. In the example, it had shown to do …

How can I Convert Calendar.toString() into date using SimpleDateFormat.parse()?

I’m developing an Android app that uses a database, every time that the user insert a new register the current data and time is save in the db using Calendar cal = Calendar.getInstance(); So, When I …

Send invites with google calendar API

I have a Java Spring API where I want to integrate Google Calendar. The task: Basically creating an event for two attendees (users) and send them an invite with the option to accept/decline (…

How to format date/time string? (Java)

Hi can anyone help please? I am trying to format a date and time string. Currently it looks like this “20160112T110000Z” and I need it to be “2016-01-12T11:00:00Z” The string without the special …

Creating a temporary copy of a Calendar object in Java

I need to figure out how to create a temporary Calendar object (a copy of a “permanent” calendar that already exists) so that I can manipulate the copy: tempCal.add(unit, value). I need to …

In Java, what is the fastest way to get the system time?

I’m developing a system that often use the system time because the Delayed interface. What is fastet way to get the time from system? Currently I’m using Calendar.getInstance().getTimeInMillis() …