Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
271 views

I have this java code: import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import java.util.Date; DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormat....
Peter Penzov's user avatar
  • 1,104
2 votes
2 answers
103 views

I have the following Java (version 8) code that parses a date time string that looks like '01-FEB-25 12.00.00.000000 AM UTC'. Expected result is a ZonedDateTime of 2025-02-01T00:00Z[UTC]. But I keep ...
isoplayer's user avatar
  • 103
3 votes
3 answers
153 views

I have some old Java code that attempts to parse a string using SimpleDateFormat. It is frequently throwing a ParseException: Non-fatal Exception: java.text.ParseException: Unparseable date: "06:...
AndroidDev's user avatar
  • 21.4k
5 votes
1 answer
508 views

I am currently working with Java's DateTimeFormatter to parse ISO 8601 formatted timestamps, particularly those containing fractional seconds. While experimenting with different timestamp formats, I ...
Ayush Jain's user avatar
1 vote
2 answers
360 views

I'm struggling with parsing strings ongoing in the "12:00 a.m." format. I tried TimeOnly.TryParse("12:00 a.m.", CultureInfo.InvariantCulture, out var result), but it doesn't work. ...
3per's user avatar
  • 384
0 votes
2 answers
425 views

I am using Java 17. I am trying to parse different strings as ZonedDateTime but when I try to convert it to an Instant, the output is not as expected. For eg: String first = "2020-01-...
jainilvachhani's user avatar
0 votes
1 answer
269 views

Is there any standard way of parsing RFC3339 compliant dateTime instead of using patterns in java ? It seems there isn't one. I tried finding solution over the internet but most of them were using ...
Yogesh A. Nikam's user avatar
2 votes
1 answer
721 views

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
821 views

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
  • 12.1k
3 votes
1 answer
330 views

fun calculateAge(dateString: String): String { val dateFormat = SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z") dateFormat.timeZone = TimeZone.getTimeZone("GMT") ...
MARSH's user avatar
  • 331
1 vote
2 answers
232 views

Both of these patterns working fine when tested separately but they are not working together in a single ofPattern { "[]" + "[]"} statement. Please guide what am I missing here ...
Sahib Yar's user avatar
  • 1,046
-1 votes
3 answers
195 views

I have a timestamp in cdt format as below "2023-06-05T09:00:01CDT", I want to convert this timestamp into MM/DD format in Java. I have tried below : The expected output was: 6/5 But was ...
BugEater's user avatar
-1 votes
1 answer
2k views

I want to sort the posts by date("hh:mm:ss"). but I get a mistake. Can you tell me what I did wrong? java.time.format.DateTimeParseException: Text '12:55:36' could not be parsed: Unable to ...
R Zav's user avatar
  • 29
0 votes
1 answer
1k views

I have two string time. How can I get a duration of period between theese two time? I try to use DateTimeFormatter, but it doesn't work. val startTime = LocalDate.parse("19:30", ...
Jekis Osipov's user avatar
1 vote
3 answers
2k views

I am using Java 11. I have a datetime string which looks like this "2023-02-17T03:56:50.254" But I know it represents a point in time in UTC time zone. How do I parse this string taking into ...
peter.petrov's user avatar
  • 39.6k
0 votes
0 answers
145 views

My epoch value is 3 days ahead of the actual time passed as input. I have a date 2023-03-21T04:34:12.234567800Z in which 00Z is the offset, but once I convert it to epoch in java, I am getting an ...
Nagesh R Shanbhag's user avatar
0 votes
1 answer
234 views

LocalDateTime time = LocalDateTime.parse("27. April 2021 00:03:50 MESZ", DateTimeFormatter.ofPattern("dd. MMMM yyyy HH:mm:ss z")); Trying to parse time string as shown above. 'z' ...
Vishal 's user avatar
1 vote
0 answers
126 views

I've been trying to parse a datetime string in a file names with datetime.datetime.strptime(). import datetime datetime.datetime.strptime('2023110912', "%Y%m%d%H%M") datetime.datetime....
Frank Li's user avatar
  • 137
-1 votes
1 answer
183 views

I want to convert a String timestamp "20221225182600Z+0100" to date in java without using simpledateformat I am getting an error Text '20221225182600Z+0100' could not be parsed at index 2 ...
VIMALJITH K's user avatar
0 votes
0 answers
29 views

Who could say - how convert this string for example - {YYYY-MM-DD_hh-mm-ss} into DateTime type in .net core? I tried regex but im really not good in it
Anton's user avatar
  • 1
1 vote
2 answers
614 views

I am sure this ust be simple, but the search engines lead me articals that answer everything but this :-( I have a string "13 February 2023 13:45:40" that I need to convert to a datetime so ...
back_ache's user avatar
  • 367
0 votes
0 answers
144 views

I have a countup app. Here is the thing: https://stackblitz.com/edit/web-platform-mjepwa?file=main.js] I have this code in my function. It sets from when the timer starts counting. past = Date.parse('...
Taimur Nishit's user avatar
-1 votes
1 answer
616 views

Trying to convert Singapore Time to UTc and need the result in OffsetDateTime. The below code works for me for all scenerios except one for 12:35..... for 12:00 noon it is somehow giving wrong results....
Varun Yadav's user avatar
0 votes
0 answers
47 views

Has anyone encountered DateTimeParseException on specific devices? I've encountered a crash that happens on a Samsung J7, Android 9 whenever this String is parsed 3/30/2023 12:00:00 AM. The parsing ...
Alvin Dizon's user avatar
  • 2,039
-1 votes
1 answer
195 views

For certain input values though format and all things are correct, I am getting ParseException from SimpleDateFormat.parse(String input) method. I'm in a scenario where I need to convert time from ...
Risabh Gupta's user avatar
1 vote
1 answer
42 views

I'm facing issue in matching the format of time date data time data '03-MAY-22 02.42.33.000000000 AM' does not match format '%d-%b-%y %I.%M.%S.%f %p' what should be the correct format for this date-...
Devendra Yadav's user avatar
0 votes
1 answer
301 views

I have string date format like below 2023-01-11 18:27:59UTC-06:00 need to convert to like 2023-01-12T00:27:59.000Z (in UTC zone) I tried the below. I am getting exception Exception in thread "...
user3763183's user avatar
1 vote
1 answer
1k views

Wednesday, 30 Nov 2022 10:30:00 (UTC) 12/08 (Thu), 10:00 GMT Each item was extracted using regex from the data uploaded in this way. With the selected items, we want to construct a localDatetime in ...
sktom2's user avatar
  • 11
0 votes
1 answer
387 views

I solved the problem itself, but I wanted to know why this is happening. The problem is this: Initially, a date and time with a time zone in String format ("dd-MM-yyyy HH:mm:ss:SSSS OOOO") ...
Кирилл Протченко's user avatar
-2 votes
1 answer
191 views

The value 12/16/2022, 1:33 pm looks to match to expected format pattern M/d/yyyy, h:mm a, what is incorrect at index 17? Java unit test: @Test public void testLocalDateTime_shortDateTimePattern() { ...
bobbyrne01's user avatar
  • 6,833
3 votes
2 answers
2k views

I have a string text that i want to parse/convert to DateTime, the text can have a different formats (depending on the user who write it), it can be "dd/MM/yyyy" or it can be "MM/dd/...
Bola Adel Nassif's user avatar
1 vote
0 answers
357 views

How do i parse a date with the format 2020-12-31T11:46:18.000+00:00 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); Date startDate = sdf.parse("2020-12-31T11:...
Tima's user avatar
  • 265
1 vote
1 answer
1k views

I want to parse the following String into an OffsetDateTime: OffsetDateTime test = OffsetDateTime.parse("2021-12-31T23:00:00.000+00:00"); However, this results in an exception: java.time....
Lars Wigger's user avatar
0 votes
1 answer
324 views

String response = "20221124112443" in this format data should come from API but i don't know but from API some different format response coming so i am getting below error and app crash ...
MARSH's user avatar
  • 331
0 votes
2 answers
588 views

I have this code: public static void main(String[] args) throws ParseException { String fecha = "2022-11-08 10:28:04.282551-06"; SimpleDateFormat simpleDateFormat = ...
JACGV's user avatar
  • 1
0 votes
2 answers
578 views

I need to parse a date that I receive in a String with the following format: "Mon, 07 Nov 2022 21:00:00 +0100" I have to dump the date to an object of type LocalDateTime and I use the ...
Alberto 's user avatar
0 votes
0 answers
63 views

Date string1: 2022-10-30T04:45:00+00:00 Date string2: Oct 30, 2022 at 04:45 GMT Date string1 and Date string2, i want formate is "yyyy/MM/dd HH:mm:ss"
YYC's user avatar
  • 1
0 votes
0 answers
32 views

today I have a really strange problem. I will try to explain it as best as I can. So the line where it fails is the third one: LocalDateTime.parse( this.text, DateTimeFormatter.ofPattern("...
Daniel Pfeil's user avatar
0 votes
3 answers
833 views

How to convert this string into instant: String date = "Fri Sep 30 00:00:00 IST 2022"; Exception: java.time.format.DateTimeParseException: Text 'Fri Sep 30 00:00:00 IST 2022' could not be ...
Aman's user avatar
  • 33
-1 votes
1 answer
114 views

I have a value like the following Mon Jun 18 11:32:05 BST 2012 and I want to convert this to 18 June 2012 How to convert this? Below is what i have tried.. public String getRequiredDate(String ...
Ravi's user avatar
  • 27
-1 votes
2 answers
1k views

I have tried these format but none worked. yyyy-MM-dd'T'HH:mm:ss'Z' yyyy-MM-dd'T'HH:mm:ssZ yyyy-MM-dd'T'HH:mm:ssZZ yyyy-MM-dd'T'HH:mm:ss Also tried "ZonedDateTime", but it is not available ...
Akanksha Paul's user avatar
0 votes
1 answer
636 views

I'm trying to parse a string as a datetime, put it as a new timezone (CEST UTC+02) and return it, but I get this error: > ValueError: time data '2022-07-04T03:15:00Z' does not match format '%Y-%m-%...
Deutrys's user avatar
  • 15
0 votes
1 answer
237 views

I've got a list of ISO 8601-compatible strings, some of which are dates (like '2022-12-25'), some are date-time values (like '2022-12-25T12:00'), and some have time zone info (like '2022-12-25T12:00-...
Justin Grant's user avatar
  • 47.2k
-1 votes
1 answer
157 views

I am trying to parse date and time coming from the api. I am getting this kind of response "ArrivalTime":"\/Date(1543469400000)\/" .How to parse this response?
Suraj D's user avatar
  • 11
6 votes
2 answers
2k views

I have a problem with parsing ZonedDateTime: DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-ddzhh:mm"); ZonedDateTime.parse(s, formatter); This results in an error: java....
FrancMo's user avatar
  • 2,789
0 votes
0 answers
44 views

I am reading date (in variable "last_time") from a website in the format: MM-dd HH:mm, I want to get this date, parse it, which I did in this code. Then I want to know how much time passed, ...
Mariam Baidauri's user avatar
0 votes
0 answers
203 views

I want to convert the date-time string into date-time object. I missing something can anybody tell me what it is I am missing? dummydate.append(datetime.strptime(row[0],"%m-%d-%Y:%H:%M:%SZ"))...
Monk_1o1's user avatar
2 votes
2 answers
2k views

I am trying to parse Instant from a CSV using OpenCsv this way: @CsvDate("yyyy-MM-dd hh:mm:ss") @CsvBindByName(column = "date") private Instant date; I know that OpenCsv is ...
Tom Carmi's user avatar
  • 654
0 votes
1 answer
103 views

I have a Dictionary<string, object> collection. and the dictionary object looks {8/8/2021 1:38:34 PM +00:00} (datetime object) Facing some milliseconds problem because of +00:00. Need to remove +...
Gokul Kumar's user avatar
0 votes
1 answer
411 views

I need to create regex that allows below time values: single digit or double digits and optionally second. All possible combination for single digit of Hour/Minute/Second: hh:mm:ss AM/PM h:m:s AM/PM ...
dsi's user avatar
  • 3,409

1
2 3 4 5
10