Skip to main content

Questions tagged [simpledateformat]

SimpleDateFormat is a concrete Java class for formatting and parsing dates and times in a locale-sensitive manner. It allows for formatting (date -> text), parsing (text -> date), and normalization.

simpledateformat
0 votes
0 answers
51 views

ERROR: date/time field value out of range: "2024-02-12 170000892" SQL state: 22008

I have the below query: INSERT INTO TEMP_USAGE_REPORTING (SELECT ABC.EPCCLASS_ID, ABC.EPCCLASS_SEARCH_PAT, ABC.SERIAL, ABC.EVENT_RECORD_DT, ABC.EVENT_RECORD_TM FROM (SELECT EVENT_EPC....
Aditya Ranjan's user avatar
-2 votes
1 answer
85 views

Possible values to be parsed using SimpleDateFormat

Sorry to ask if this is a duplicate question as I try to find solutions online but couldn't get a confirmed answer. I would like to know the possible values that can be used to parse using ...
Trowa's user avatar
  • 365
-1 votes
4 answers
137 views

Change date format DatePickerDialog- Android studio Java

Does anyone know how to change the date format in DatePickerDialog in Android studio in Java, I need like "Mon, May 6" I need like this format instead of "M05 6, Mon"Image link . ...
Shiyaam's user avatar
  • 11
0 votes
0 answers
49 views

How might my API be receiving an incorrectly formatted ISO 8601 timestamp

I have an iOS/Android app sending data to the Python backend. In both apps, the user selects a date and time from a picker, and it is sent to the server: Android: SimpleDateFormat simpleDateFormat = ...
alstr's user avatar
  • 1,516
2 votes
2 answers
124 views

SimpleDateFormat gives a wrong date when input a wrong format date string

code is SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); Date date = format.parse("2024-03-01 09:20:46"); the date's value is Sun Dec 03 00:01:09 ...
yifu_yang's user avatar
1 vote
1 answer
61 views

Execute Date arithmetic without daylight saving adjustment

I want to parse a Date from a String in NYC timezone, add 1 day and then output string. like: parse to date add 1 day output The problem is, that when I parse a date during the adjustment for ...
VextoR's user avatar
  • 5,157
2 votes
1 answer
187 views

I got the error "java.text.ParseException: Unparseable date: "1/10/24 7:00 PM"" when trying to parse

I have a date string as "1/10/24 7:00 PM" (10th Jan.2024). How to parse it using SimpleDateFormat? String date_time = "1/10/24 7:00 PM"; Instant answer; try { answer = Instant....
Shivam Agrawal's user avatar
1 vote
3 answers
288 views

Parse string date to millis in kotlin

I am using SDF to parse a string date to millis with below code private fun dateToMilliseconds(dateValue: String): Long? { val sdf = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS") val date: ...
WISHY's user avatar
  • 11.7k
-1 votes
2 answers
92 views

How to convert a string with extra characters

How to convert a string with extra characters String str = "file-09-01-2024" pattern = "dd-MM-YYYY" using SimpleDateFormat with pattern = "dd-MM-YYYY" I don't know how ...
Ignatyo's user avatar
  • 25
0 votes
0 answers
70 views

Unparseable date Exception on Unit Testing via Mockito

In my case, i am in need of get the string date as format i prefer , below is the exact code i am using to get the return date as string Below is the Test Function: @Test fun `get formatted server ...
arun's user avatar
  • 205
0 votes
1 answer
91 views

Why is Java epoch time off by 30 minutes when parsing via SimpleDateFormat

Somehow parsing date time strings and converting them to milliseconds after the epoch works differently in different environments. It would seem something is off with the timezone or something. In ...
Adam Wise's user avatar
  • 2,180
1 vote
2 answers
104 views

Calendar Class method in Java seems to be not giving correct result [duplicate]

Can someone please explain why is the behavior of the below piece of code not as expected. import java.util.Calendar; import java.util.Date; import java.text.SimpleDateFormat; public class Test { ...
Nagraj1990's user avatar
2 votes
2 answers
91 views

Date Pattern starting from 12 hours

I'm trying to convert two dates into this pattern: yyyy-MM-dd HH:mm:ss.SSS. I need to retrieve two dates: Last year, same month, day 1, 00:00:00.000 Last day of previous month, 23:59:59.999 So, as ...
Marco Frag Delle Monache's user avatar
-2 votes
2 answers
356 views

How to convert Date from 2023-11-10 09:44:00.038860 to 2023-11-10T09:44:20.001+00:00 in spring boot application

I am getting response from ELK and mapping it to an object using ObjectMapper and then return the response as JSON. The ELK response has a Date datatype field with the format yyyy-MM-dd HH:mm:ss....
Keerthana Hemachandran's user avatar
0 votes
2 answers
231 views

Simple Date format not recognised

I am on Windows 10 with Java 17 using Simple Date Format. I am trying to get a date format like 2023-10-12 21:26:16 but instead I get 2023-Oct-12 21:26:16. The date is inside a Jackson 2.15 ...
Ray Bond's user avatar
  • 487

15 30 50 per page
1
2 3 4 5
177