Skip to main content
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,094
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
358 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

15 30 50 per page
1
2 3 4 5
31