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
-4
votes
1 answer

Given 2 LocalDateTime generate filters based on days or days/hours

I would like to have a method that given a time interval granularity (e.g. DAY, HOUR, etc.) and 2 LocalDateTime a and b generates a string of the following type: let's assume a = '2018-01-01 12:23:23' and b = '2018-01-10 15:18:13' if the time…
alexlipa
  • 1,131
  • 2
  • 12
  • 27
-4
votes
1 answer

Constructor chaining to print date

How can I print date using constructor chaining in java ? I am getting error after this(6,2018) stating I need two argument constructor why is that? And when i use the quick fix a new constructor Date(int i, int j) is created. I am unable to…
naman_rai
  • 3
  • 1
-4
votes
3 answers

Java LocalDate / LocalDateTime - Hour Between

How do I know if an hour is between two schedules? Example: 10:00 is between 8:00 and 12:00? 7:30 is between 8:00 and 12:00? I'm trying this way: LocalDateTime s = LocalDateTime.of (2017, 10, 20, 8, 00); LocalDateTime f = LocalDateTime.of (2017,…
Mamga
  • 121
  • 2
  • 12
-4
votes
2 answers

LocalDate format

What way can I format the localdate for the auctions, Keep getting an error asking to change constructor to a string but I need it to be a LocalDate public static void main(String[] args) { user1 = new User("fred", "fredbloggs"); user2 = new…
-5
votes
2 answers

How to convert String inot a LocalDate object

I have a String value as follows 2018-12-05 18:11:27.187 How can I can convert it into a LocalDate object based on that format "MM/dd/YYYY HH:mm:ss" ?
angus
  • 3,210
  • 10
  • 41
  • 71
-5
votes
2 answers

Time information is missing when converting LocalDate to java.util.Date

Time information is missing when converting LocalDate to java.util.Date My input date is in the format "2019-08-30T19:47:22+00:00" (String). I have to convert it to java.util.Data. I would like to do it using java 8. String input =…
Thiagarajan Ramanathan
  • 1,035
  • 5
  • 24
  • 32
-5
votes
1 answer

Converting String 'yyyy-mm' in two localdatetime java 8+

I have a string that constrains a month and year ex: 2019-02 and I need to converter in two LocalDateTime. I need an first day and the last day of month 02.
-6
votes
3 answers

how to convert LocalDate to a specific date time format

how to convert ISO_LOCAL_DATE to date time format : yyyy-MM-dd'T'HH:mm:ss.SSSZ in java Ex: given date: 2016-01-25 to 2016-01-25T00:00:00.000+0100
Viswanath Nuggu
  • 63
  • 1
  • 1
  • 9
-6
votes
1 answer

how do I create a LocalDateTime variable in java?

if I only have the year, the month, and the day, how do I initialize a LocalDateTime variable? also if I need to include time, I will just set it to 00:00:00 thank you so much!
Jenn
  • 1
  • 1
  • 1
-30
votes
3 answers

How to format java.util.Date with DateTimeFormatter portable?

How to format java.util.Date with DateTimeFormatter portable? I can't use Date in = readMyDateFrom3rdPartySource(); LocalDateTime ldt = LocalDateTime.ofInstant(in.toInstant(), ZoneId.systemDefault()); ldt.format(dateTimeFormatter); because I…
Dims
  • 47,675
  • 117
  • 331
  • 600
1 2 3
43
44