Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
83 views

Currently, in Java I have tested using IBM SimpleDateFormat and Java DateTimeFormat, both cannot parse "Rab, 25 Agt 2025" due to IBM and Java only recognize "Agu" Is there any ...
Deddy Chandra's user avatar
2 votes
2 answers
204 views

I have a small test table in Postgres with a DATE field, and data class in Ktor app. When mapping the database table row result to TestItem the 'updated' LocalDate field generated the error. import ...
Andrey Karpenkov's user avatar
-1 votes
1 answer
163 views

I'm updating my code to use java.time.format.DateTimeFormatter instead of java.text.SimpleDateFormat and now a test fails which didn't before. When I parse the String 2010-12-31 00:00:00 , which in my ...
Loris's user avatar
  • 9
3 votes
2 answers
54 views

I have a Kotlin code that retrives date (in text field) from SQLite DB and put it into a LocalDate variable (pill.startDay) from whom I show the date as below val dtf: DateTimeFormatter = ...
genespos's user avatar
  • 3,321
0 votes
1 answer
89 views

I'm using SQLite for my database, but the result for date_logged is showing me an unexpected value, like 1731279600000, instead of the date I entered (e.g., 2024-11-12). I used H2 for my database ...
Haerin's user avatar
  • 15
0 votes
1 answer
74 views

I need to insert a Date Field into an SQLite Database. I am using Kotlin and I chose LocalDate class to handle Date. I've created a class which has a field LocalDate: data class Pillola(..., val ...
genespos's user avatar
  • 3,321
-1 votes
1 answer
134 views

I get this error while trying to pass the date 2024-12 in the following code: DateTimeFormatter formatter = DateTimeFormatter.ofPattern("uuuu-MM"); LocalDate expiration = LocalDate.parse(exp,...
Alvin Masih's user avatar
0 votes
1 answer
38 views

I have a spring boot app that I want the admin to be able to get the system report based on the month and year selected. System report in this case is the number of sales that was made in the selected ...
Ukeme Elijah's user avatar
2 votes
1 answer
58 views

I'd like to be able to format strings based on Java.LocalDate using the f interpolator, i.e. something like: val = LocalDate.of(2024,7,28) f"$dt:YYYY-MM-dd" But this will give a compile ...
David Regan's user avatar
-1 votes
1 answer
336 views

I am creating a Rest API applicaton which tracks users` expenses. I have date variable of type LocalDate and the default format is yyyy-mm-dd but I want to store dd/mm/yyyy in the database what I ...
Awale's user avatar
  • 1
0 votes
0 answers
127 views

When I'm trying to cache book in redis I'm running into this problem. Config classes: @Configuration @EnableCaching @RequiredArgsConstructor public class CacheConfig { private final ObjectMapper ...
WlfromB's user avatar
2 votes
2 answers
957 views

Given the following code LocalDate localDateEpoch = LocalDate.parse( "01-Jan-2017", DateTimeFormatter.ofPattern("d-MMM-yyyy", Locale.FRENCH)); System.out.println("...
ryn's user avatar
  • 331
1 vote
2 answers
1k views

I am using java 8 version in my application, I have confused to use java date classes like java.util.Date and java.time.LocalDate at entity and dto level. Before java 8, we used to use either java.sql....
Anil Nivargi's user avatar
  • 1,747
0 votes
1 answer
67 views

I have a LocalDate field of an entiry class as below. @DateTimeFormat (pattern="dd-MM-YYYY") private LocalDate myDate; I have a Date object when printed displays Thu Jul 07 00:00:00 IST ...
itsraja's user avatar
  • 1,746
0 votes
1 answer
28 views

I'm writing a solution in Scala based on Spark 3.5.0 that has complex map/seq data structures of dates where I need to represent missing dates with null or None. As this is scala my preference is None,...
David Regan's user avatar
0 votes
1 answer
78 views

I am trying to convert the date string that has full month name using LocalDate but I am getting java.time.format.DateTimeParseException: Text could not be parsed at index 6 I tried looking online but ...
VinnyTech's user avatar
0 votes
0 answers
32 views

Trying to do a backend with Springboot. Now I'm trying to do petitions with postman to see if code works. For now, GET & POST are working. The problem comes whenever I'm doing a PUT petition with ...
Miguel Angel Guaita's user avatar
0 votes
2 answers
66 views

I have a SpringBoot 2.6.14 web-app with JPA 2.2 and Hibernate 5. Now I have a String with this format "2024-03-04T14:10:37.000Z" And, following some instruction (googling around) I write ...
CoderJammer's user avatar
2 votes
0 answers
158 views

DateTimeFormatter formatters = DateTimeFormatter.ofPattern("uuuu-MM-dd"); endDate = LocalDate.parse(endDateString, formatters); Why does the above code not throw exceptions for leap years? ...
Mazin Ismail's user avatar
0 votes
1 answer
50 views

I am working on a Java assignment for school. In this method, I am trying to save to a file as described by assignment, but I am getting an error when calling clothing.getLastWornDate() and am lost as ...
Wremmurg's user avatar
0 votes
1 answer
78 views

I'm trying to compare two dates using LocalDate in my Expire date table. The problem is that I cannot set properly row formatting according to dateExpiry. This is how it should look: if (today....
Marian34's user avatar
0 votes
1 answer
51 views

I have tried to update a field in the MongoDB database namely the "Status" field (of type integer) only between two dates FromDate and ToDate. no errors or warnings were obtained, however, ...
Jean pierre Atanas's user avatar
1 vote
1 answer
371 views

You can create a DateTimeFormatter with multiple patterns using the DateTimeFormatterBuilder, but LocalDate.parse doesn't seem to like it. It works with a single pattern and fails with mutliple ones. ...
t3chb0t's user avatar
  • 19.3k
2 votes
1 answer
4k views

I know this may sound awkward after 3 years of software development, but I'm trying to better understand the java.time classes and how to use them to avoid errors and bad practice. On the first ...
Paul Marcelin Bejan's user avatar
1 vote
2 answers
125 views

i have below code End date = 31 oct 2024 and elapsedPercentage is 10% of total duration on current date as per above params expected Start date value is 12 aug 2023 but i am getting 07 Dec 2023 ...
ømi's user avatar
  • 509
0 votes
1 answer
177 views

I want to create a list of persons sorted by LocalDate and String as well as aggregated by duration. I did some research regarding the use of duration in streams: How to get the average duration for ...
Mc_Android's user avatar
0 votes
0 answers
63 views

Consider below example , inputList has overlap date ranges inputList.add(new DateRange(LocalDate.of(2023, 7, 1), LocalDate.of(2023, 7, 10))); inputList.add(new DateRange(LocalDate.of(...
venu's user avatar
  • 11
0 votes
2 answers
221 views

I'm currently based in Europe/London I am trying to get the current day in Samoa, which is 27 July with the following code: LocalDate localDate = LocalDate.now(ZoneId.of("Pacific/Samoa")); ...
Joao Pedro's user avatar
0 votes
0 answers
94 views

This used to work under Groovy 3.x version but fails in 4.x LocalDate startDate = LocalDate.of(2023, Month.JULY, 1) LocalDate endDate = LocalDate.of(2023, Month.JULY, 31) LocalDate[] ...
developer's user avatar
-1 votes
2 answers
212 views

I have 2 date values and a set of rows which have a range defined as discount_start_month and discount_end_month. The current situation is that I only have month information as below, there is no year ...
oldcode's user avatar
  • 1,721
0 votes
1 answer
841 views

I'm trying to convert a java.time.LocalDate to java.util.Date, but I lose some days in the process. Here the code that shows the issue: public static void main(String[] args) { var localDate = ...
Abadellatif Abazine's user avatar
2 votes
1 answer
158 views

I am parsing a String to LocalDateTime (by ThreeTen, not the Java one) with this method. for input: 28-Aug-20 10:37:41 AM BST private fun toLocalDate(date: String?): LocalDateTime? { return ...
Sourav's user avatar
  • 412
2 votes
1 answer
224 views

I see that java.time.Period with java.time.LocalDates works mostly as desired and I can use it to get the duration between two dates in years, months and days but I found an example that is not ...
prom85's user avatar
  • 18k
0 votes
2 answers
776 views

I've made a simple method which is used to convert a timestamp retrieved from a database into a LocalDate. However for some reason I keep getting the wrong day in the conversion. I've shared the code ...
skippy130's user avatar
  • 313
0 votes
1 answer
1k views

In my android project I need to go through data base and take some values from a current record, but only if this record has the date I need. I tried googling it and i dont think there is a good ...
Арсен Газимов's user avatar
1 vote
1 answer
627 views

I am trying to parse an incoming string which might contain time or not. Both the following dates should be accepted "2022-03-03" and "2022-03-03 15:10:05". The DateTimeFormatter ...
Abhinash Jha's user avatar
-1 votes
1 answer
269 views

I have in my form any inputs with date value, but don't show value. If I input the date when sent to backend don't receive this information. I use LocalDate I'm use this dependencies: <dependency&...
user3389425's user avatar
1 vote
1 answer
120 views

I am trying to validate incoming date string and then convert it to a LocalDate. Here is my code: public class DateTester { public static void main(String[] args) { System.out.println(&...
happytohelp's user avatar
1 vote
2 answers
1k views

I have object object func1{ def something(arg1: Int): String{ // var date = something2() // Using date } def something2(): LocalDate{ LocalDate.now() } } I want to ...
Pawan Asipu's user avatar
3 votes
1 answer
73 views

I have 2 dates: LocalDate date1 = LocalDate.now().minusDays(40); LocalDate date2 = LocalDate.now(); I want to figure out what is the biggest time unit I can pick to define the difference between the ...
Tom Carmi's user avatar
  • 654
1 vote
2 answers
682 views

I am trying to format the String date, time and zone information. LocalDateTime.parse("Dec 01, 2019 1:00:00 PM +00:00", DateTimeFormatter.ofPattern("MMM dd, YYYY hh:mm:ss a XXX")); ...
Punith Raj's user avatar
  • 2,223
1 vote
1 answer
5k views

My Local date Time(Shipping) in the format like "2023-01-11T01:25:59" I need to compare with current time do the below conditions If both are in same date and Shipping hour more than ...
user3763183's user avatar
2 votes
1 answer
2k views

I want to compare LocalDate with the timestamp in database (Postgres with UTC timezone). code I wrote @Query(""" select eve from Events eve where cast(to_timestamp(pe....
Mohit Kumar's user avatar
-2 votes
1 answer
142 views

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 ...
Saurabh Kohade's user avatar
1 vote
1 answer
163 views

I am building a Calendar app to save events, show them and edit them with DatabaseHelper. I want to add alarm to these events but every I can find only setting alarm with Calendar import library. I ...
Chris Damianidis's user avatar
3 votes
3 answers
822 views

My goal is to display a date in a format like: Country example pattern US Tue, Jan 3 EEE, LLL d France mar. 3 janv. EEE d LLL I'm using DateTimeFormatter.ofPattern to format my dates. Is there a way ...
Sean's user avatar
  • 3,158
0 votes
1 answer
2k views

I have two localDate to convert: 2022-11-02 and 0001-01-01 I am using the same method: Date.from(myLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant()) LocatDate 2022-11-02 is fine with result ...
feiyechen's user avatar
  • 121
2 votes
1 answer
242 views

In my app, I want to filter data based on age range. The problem is that I didn't store the age in the database so I have to use the birthdate. This is what I did so far but it's incorrect: public ...
Vince Ybañez's user avatar
-1 votes
1 answer
86 views

Can I know how can convert one date format to another date format. public static LocalDate localDateToAnotherLocalDate(String oldPattern, String newPattern, String input) { DateTimeFormatter ...
bharathi's user avatar
  • 6,298
-1 votes
1 answer
2k views

The code below gives me the error 'valueOf(java.lang.String)' in 'java.sql.Date' cannot be applied to '(java.time.LocalDate)', which I understand means that valueOf is expecting a string... but ...
dan's user avatar
  • 369

1
2 3 4 5
14