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
-1
votes
2 answers

How to parse 2019-02-17T18:39:03?

I looking for a solution to parse the String date. datestring.add("2019-02-17T18:39:02"); datestring.add("2019-02-17T18:39:01"); datestring.add("2019-02-17T18:39:03"); datestring.add("2019-02-17T18:39:07"); datastring is the ArrayList of String…
jibs
  • 3
  • 1
  • 5
-1
votes
2 answers

Extract date in Portuguese from String Java

I'd like to extract data from a String, and this String sometimes appears in different ways. For example, it could be any of the following: Portaria n° 200, 28 de janeiro de 2018. Portaria n° 200, 28 de janeiro de 2018 da Republica…
-1
votes
1 answer

ParseException when parsing a date of yyyy-MM-dd format

private SimpleDateFormat dateFormatMonth = new SimpleDateFormat("dd/MM/yyyy", Locale.getDefault()); Date date = dateFormatMonth.parse(strtdate[0]); strdate[0] contains "2018-06-11" I'm getting a unparsable exception on this…
-1
votes
1 answer

How add LocalDate list to myList in Java

How add Local date list to myList in java Please find the below code and check where I made a mistake to add dates to myList I declare List as Local date now need to convert to myModel error occurs in // …
chalam
  • 29
  • 5
-1
votes
5 answers

Convert String to Date and remove day value (always set 1 day of month)

I can convert a String to a Date: private static final SimpleDateFormat CARD_DATE_FORMAT = new SimpleDateFormat("yyMMdd", Locale.getDefault()); public static Date toCardDateFormat(String date){ try { return…
ip696
  • 6,574
  • 12
  • 65
  • 128
-1
votes
3 answers

Date parsing. How do I parse this date format?

How do I parse this date format: "/Date(1514728800000+0300)/" I don't know what the meaning of this number is, or that of the + sign.
Ibrahim Disouki
  • 2,642
  • 4
  • 21
  • 52
-1
votes
5 answers

Conversion to java.sql.Date

I have a String as below which needs to be converted into java.sql.Date format: 2017-08-31 01:40:00+00:00 I am using below code and I can see date is only parsed as 2017-08-31 and not the entire string as above. Can someone please…
Shankar Guru
  • 1,071
  • 2
  • 26
  • 46
-1
votes
2 answers

How to check and parse different date styles

I am getting date of birth data from a table where Oracle column type is varchar2 instead of date where the main reason is that data is parsed by a CV parsing company because different CVs has various style of date of birth…
Ghayel
  • 109
  • 1
  • 3
  • 14
-1
votes
2 answers

Time conversion using php

Is there any way to convert "01:10:00" string into the following format "1 h:10 min" using php? I did this way, but I need to do the opposite. 'date('H:i:s',strtotime('1 hour 1 minute 1 second', strtotime('midnight')))'
-1
votes
2 answers

how to solve the error when convert string date to integer?

I would like to convert my string date to int but I get an error, example of my date 'dim. janv. 23 24:00:00 +0000 2011` This is part of my code : String created_at = (String) jsonObject.get("created_at"); System.out.println("la date de…
celia
  • 29
  • 1
  • 7
-1
votes
2 answers

How to extract the values of a date in y-m-d format?

Let's suppose I have this date: 2016-07-27. What I want to achieve is: $year = 2016; $month = 07; $day = 27; What I have tried: $year = preg_match("/^[^-]*/", "2016-07-27");It returns: 1 $month = preg_match("(?<=\-)(.*?)(?=\-)", "2016-07-27");It…
Angel Politis
  • 10,955
  • 14
  • 48
  • 66
-1
votes
3 answers

Date parsed with gmt + 2 hours

I always get the wrong date when I use var date = new Date(timestring), there is always +2 GMT hours. var unsortedPlayTimes = [{date:'2014-08-11T09:30:00'}, {date:'2014-08-11T08:30:00'}, {date:'2014-08-11T08:15:00'}, …
-1
votes
3 answers

Date from two strings on android

I have two strings for a date (using the current year): a day = "15" a month = "7" With this data I would like to have a string date with this format: Tuesday July…
JoCuTo
  • 2,463
  • 4
  • 28
  • 44
-2
votes
1 answer

How do I tell PHP's datetime parser that I want the "next" rather than necessarily "the current year's" date?

I get stupid datetimes such as this from the outside: Jan-02 19:00 That means "the next 2nd January, 19 o'clock". Currently, since the current time is in the very end of 2021, that means 2022-01-02 19:00. But if I sen that to the datetime parser in…
-2
votes
1 answer

How to get date from a string without formatting?

I have a String s = "2020-02-22"`; and I want to change it to Date so I can store it in my database which has has a column that does not accept anything but Date. I tried using the LocalDate class but it's in API 26. Any help would be appreciated.
sammy
  • 3
  • 2