Questions tagged [localdate]

LocalDate is part of the java.time package and represents a year-month-day in the ISO calendar and is useful for representing a date without a time, such as 2000-01-01 (January 1st 2000). It can be used for storing a birth date for example.

656 questions
-1
votes
1 answer

Getting remaining minutes/hours between current time and the next saturday?

I've been looking through the docs for the better part of the day now and have been unable to figure out how exactly this should be done. I'm looking to run an event every week, every saturday at 00:00 until monday 00:00 (48h). public static void…
Temsei
  • 41
  • 2
  • 5
-1
votes
3 answers

Convert minutes to hours scala

I have a number in minutes, for example: Int totalminutes= 342 I want to dispaly it like this: 5h:42m:..s I did a scala function to convert the minute to hour and return HH:MM:SS scala> def convertSeconds(input:Int):String ={ | val…
vero
  • 1,005
  • 6
  • 16
  • 29
-1
votes
1 answer

How add LocalDate list to myList in Java

How add Local date list to myList in java Please find the below code and check where I made a mistake to add dates to myList I declare List as Local date now need to convert to myModel error occurs in // …
chalam
  • 29
  • 5
-1
votes
2 answers

Methods which calculates month count between 2 dates which works in contract with LocalDate#plusMonths method?

I need to manipulate with dates according my task. To be precise I need to check that we have month difference between 2 dates as integer. 2 dates- input arguments. Result - boolean: true if month count is exact(without tail) false otherwise. For…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
-1
votes
1 answer

converting String to LocalDateTime in Java

I'm trying to convert String to LocalDateTime object, but java is not letting me. String date = in.nextLine().trim(); DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE; LocalDateTime dateTime = LocalDateTime.parse(date,…
-1
votes
3 answers

Parsing a date with an +0000 and T

I am having trouble parsing the following date into a LocalDate object. 2017-11-10T14:17:38.611+0000 I tried the following: LocalDate date = LocalDate.parse(markitDate, DateTimeFormatter.BASIC_ISO_DATE) but, I get an error that the letter T cannot…
kgui
  • 4,015
  • 5
  • 41
  • 53
-1
votes
2 answers

Sorting 2D Arraylist of Object

I have 2D Arralist of Object and i want to sort it upon first column which contains LocalDate i used this code to sort it DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d/M/yyyy"); formatter = formatter.withLocale( Locale.US…
user1814596
  • 25
  • 1
  • 7
-1
votes
1 answer

IsAfter Usage of Local Date Time In JAVA

I am facing the issue with localDateTime in JAVA. I am using the isAfter function to compare the two date time but only returns correct value if there was a variation in time but not the date. Program: import java.time.LocalDateTime; public class…
devanathan
  • 768
  • 3
  • 10
  • 39
-1
votes
3 answers

Change String to date using LocalDate in Java

I need to change String date="20160101" to "January 1,2016" by using LocalDate. Right now, my code looks like this: DateTimeFormatter formatter = DateTimeFormatter.BASIC_ISO_DATE; LocalDate date = LocalDate.parse("20120403",…
Ahab
  • 1
  • 1
-1
votes
1 answer

Determine what day of the week the first of that month falls on and store the day numbers starting at that position

I am trying to populate an array with the date in there, For example, this month August, it should show Sunday Monday Tuesday Wednesday ... Saturday null 1 2 3 ... 6 ... ... ... ... ... ... It is…
Ya Yan
  • 63
  • 13
-2
votes
1 answer

calculate the expiry in working hours and working days java

The expiry should be after 8 working hours (8 am to 5 pm UTC monday to Friday) for example the created date at 7 pm UTC time, the expiring time should be counted from next morning 8 am to 5 pm UTC time and expire. So it should expire at 4 pm UTC …
-2
votes
1 answer

How to convert Java LocalDate to milliseconds

I am trying to convert a date formatted in yyyy-mm-dd to LocalDate to milliseconds with this code. LocalDate.parse("2022-08-01", DateTimeFormatter.ofPattern("yyyy-MM-dd")) …
Bitwise DEVS
  • 2,858
  • 4
  • 24
  • 67
-2
votes
1 answer

How to parse string (such as "Sunday, July 4, 2021") to LocalDate?

I am trying to parse a string "Sunday, July 4, 2021" to LocalDate as the following: string this.selectedDate = "Sunday, July 4, 2021"; LocalDate date = LocalDate.parse(this.selectedDate); But I am getting this…
Khaled
  • 345
  • 5
  • 14
-2
votes
1 answer

How to find the day when year, month and date is given?

I need a solution to return day (Monday,Tuesday...), when i have inputs like YEAR, MONTH, DATE. public static String findDay(int month, int day, int year) { // code here }
Vaibhav Atray
  • 208
  • 4
  • 14
-2
votes
3 answers

Java LocalDate How to utilize

input list from date ex) 2020-10-01 to date ex) 2020-10-30 List [day of week] ex) [sun,mon....] List [week] ex) [1,4,5] I would like to know how to get a specific day of the week…
sc m
  • 13
  • 2