Questions tagged [date-parsing]

Date-parsing refers to programming logic which reads one or more parameters, attempts to match it to a supported or specified date format, then returns the resulting Date if successful.

References

494 questions
0
votes
2 answers

Why date_parse does not recognise years in a string

Why date_parse does not recognise years in a string? result, Array ( [year] => [month] => 3 [day] => 23 [hour] => 20 [minute] => 13 [second] => 0 …
Run
  • 54,938
  • 169
  • 450
  • 748
0
votes
3 answers

Adding date value to ArrayList in Android

From a web service I am getting a date value like "2011-05-31T00:00:00.000+03:00" and I want to add it into an arrayList(String). How can I parse it to String and write it like "31.05.2011" to the array?
arenko
  • 174
  • 1
  • 4
  • 16
0
votes
3 answers

Java date parser fails on timezone UT and UTC

I'm wondering if Java's SimpleDateFormat can be salvaged to parse the timezones UCT and UT? E.g. SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy H:m:s Z"); String date1 = "Wed, 10 Oct 2012 11:21:22 UT"; //fails to parse String…
djechlin
  • 59,258
  • 35
  • 162
  • 290
0
votes
1 answer

Date format exception after setting diiferent locale in android

I have one problem in my application. I am developing my application for 6 different languages: 1) english 2)russian 3)french 4) italian 5)portugish 6) hindi Now my application works fine for english language but when I set locale of other…
bindal
  • 1,940
  • 1
  • 20
  • 29
-1
votes
1 answer

How to parse mm.dd.yyyy with opening_hours.js?

I am using opening_hours.js in my project. Given the raw input data comes as: 03.09.2021-05.09.2021 Fr 14:00-22:00, Sa 12:00-22:00, Su 12:00-20:00 I there a way to configure the library/parser for the given input date format…
JJD
  • 50,076
  • 60
  • 203
  • 339
-1
votes
1 answer

In JavaScript (Node.JS), how do I parse a value like '202111031437' to output date?

Have previously tried to use Date.parse() but 'undefined' is returned. let datetime = '202111031437'; let parse = Date.parse(datetime); console.log(parse); Solved the query: const dateParser = (dateString) => { const year =…
-1
votes
2 answers

String to date format and vice versa

String dateFormat = "20211109"; SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy"); Date strtDt = sdf.parse(dateFormat); String strt = sdf.format(strtDt); I am getting an error Unparseable date: "20211109" How to convert date into given…
Aaa
  • 31
  • 1
  • 5
-1
votes
1 answer

Text '28Feb2020' could not be parsed, unparsed text found at index 7

Input Text is 20FEB2020 The following code block throws a DateTimeParseException with the message Text '28Feb2020' could not be parsed, unparsed text found at index 7: String issueDate = abcIssueDate.substring(0, 3) +…
-1
votes
1 answer

How to parse the date for February and months with 31 days?

I thank you for possible answers. The problem is, I work with a legacy system with Java 1.4. In a registration form you have the following fields: 'Period' in the mm / yyyy format 'Expiration Day' Concatenate the day with the period and parse for…
marcioasan
  • 11
  • 2
-1
votes
1 answer

DateTime.toString not accounting for PM correctly from "dd/MM/yyyy h:mm:ss tt" to "yyyy-MM-ddTHH:mm:ss.fffZ"

I am hitting a bit of a wall with this one. I am currently trying to capture a DateTime in the format of yyyy-MM-ddTHH:mm:ss.fffZ as a string for an API call. However my original timestamp is currently formatted as a string like dd/MM/yyyy h:mm:ss…
-1
votes
1 answer

Convert to DateTime from a string '10-April-2020'

Looking for assistance in converting a date string i receive from a web form, where the format will be something like "10-April-2020". I need to save this into the database in the US date format "yyyy-mm-dd" so that the example date provided would…
Stephen85
  • 250
  • 1
  • 15
-1
votes
1 answer

Parsing date error on lower android version in flutter

var birthDate= DateFormat('yyyy/M/dd').parse(tempBirthDate); print(birthDate); String dtStringBday = DateFormat('yyyy-MM-dd').format(birthDate); //print result: 1967-08-16 00:00:00.000 Hi I'm using this code to parse and format my date. But…
unice
  • 2,655
  • 5
  • 43
  • 78
-1
votes
1 answer

How to parse a calendar week number in Go

How can I turn a string containing the year and an iso week date into a time object? This is how the string I have looks like: 2020-15, where 2020 is the year and 15 is the iso week number. Ideally, I would like to get the first available timestamp…
-1
votes
6 answers

How to sort objects according to string date in java

I am creating an android application where I need to sort objects according to date. The date is stored as a String in Customer Object. How can I do it? I have already tried it using the Collection.sort() method but with no success. public static…
Anas khan
  • 175
  • 1
  • 3
  • 13
-1
votes
1 answer

When I used guard case in sum_time method one test case failed, any suggestions?

Write a method that sums up multiple 24-hour time values(h:m:s). Validate the time using regular expressions. Input and output format : Eg: ("11:23:07","22:53:45","0:23:23","23:45:56") -> "2 day & 10:26:11" ("11:23:07") -> "11:23:07" My code is…