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
vote
1 answer

Parsing SQL AM/PM for comparison

Is it possible to parse AM & PM times in SQL and use them for comparison? For example, a statement like the following: STR_TO_DATE(pack_time_min) <= DATE_ADD(NOW(), INTERVAL 1 HOUR) With data like so: 1:30pm
Oliver Kucharzewski
  • 2,523
  • 4
  • 27
  • 51
1
vote
0 answers

Why a string with containing a space and a number can be parsed to Date?

I'm working on a Date validation function for a custom render in my web app. When I get a string like "abc", what I do is try to parse it to Date using Date.parse() and it returns NaN since it's not parseable. The interesting part comes when I get a…
ivandevp
  • 54
  • 6
1
vote
0 answers

Laravel carbon parse is giving incorrect output

I am working on chronic care health project in which i have to set future dates for patient injection. The doctor select start date for injection and then he select 3 days (i.e. Monday, Wednesday, Friday etc) which means patient will come 3 times a…
Amir Khan
  • 183
  • 2
  • 16
1
vote
1 answer

Parsing arbitrary format JSON date with Swift Decodable

I am attempting to format a date in a JSON document into the format "mm-dd-yyyy". I have the following data: {"data":[{ "id": 123, "url": "https://www.google.com", "title": "The Google link", "created_at":…
Ace
  • 603
  • 2
  • 15
  • 33
1
vote
1 answer

Java.time - Parsing a month's name not working

I have to handle timestamps received from an external API in Java. An example of the datetime format could look like this: "May 9, 2018 5:32:31 PM CEST" After looking up information found in the documentation at DateTimeFormatter#Predefined…
Der_Reparator
  • 86
  • 1
  • 9
1
vote
1 answer

how to convert date from 31-AUG-18 to AUGUST31,2018 in Java

I'm getting a date as input in the format of 31-AUG-2018. I would like to convert it into AUGUST31,2018 using java
ArunBharath
  • 143
  • 2
  • 17
1
vote
1 answer

Determining whether a string is date or a number

I need to reliably determine if a user inputted string is a date or a number. Consider the string 1.1. This string successfully parses to a double using double.TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, CultureInfo.CurrentCulture,…
1
vote
2 answers

After converting string to date format month showing different

I am converting string to date format year and date showing correct but month showing different. String s = "2018-08-29" try { DateFormat formatter = new SimpleDateFormat("yyyy-MM-DD", Locale.ENGLISH); Date parse =…
jyothish
  • 117
  • 1
  • 10
1
vote
2 answers

Java Regular expression on subgroup

I have the following question about Java Regular expression. When I am defining a regular expression using pattern: String pattern = "(\\d{4})\\d{2}\\d{2}"; and the input string is "20180808", I can get the group(0) - 20180808 but group(1) - not…
manpakhong
  • 11
  • 3
1
vote
3 answers

Unable to parse correct total hours from Wednesday to Thursday in java

I am having an issue while parsing day and time to get the total hours and minutes in java. If I calculate total hours starting from 'Mon 22:00' to 'Tue 22:00' then I am getting correct total hours 24. But If I calculate total hours starting from…
1
vote
1 answer

How to find all regex strings in python dateparser

I am using dateparser modules to parse some human readable text to python date time objects. For now I am having a list of regex strings and applying on input strings to find out is there any matches. I want to use full list of regex list that…
kishore
  • 413
  • 1
  • 4
  • 20
1
vote
3 answers

Parse Different Date formats: Regex

reposting this questions with specifics (because the last one was flagged down). I am working on parsing messy (tessearct-ocr) from archives cards to get atleast 50% of the info (date1). The data rows contain dates in different forms as per data…
1
vote
1 answer

Regex, matcher, and DateTimeParseException: Text '01/08/2018' could not be parsed at index 0

I am getting this issue java.time.format.DateTimeParseException: Text '01/08/2018' could not be parsed at index 0 from this code below. Not sure what other options I have to parse a string by using this matcher. String dateString = "At…
user2537246
  • 143
  • 2
  • 10
1
vote
2 answers

Parsing dates with Pandas: how to take time zones into account?

I have dates in these formats: Thursday, September 22, 2016 at 11:04am UTC+02 Monday, January 22, 2018 at 6:46pm CST ... I want to convert them to UNIX timestamps. This pattern works, but it ignores the timezone: timestamp = pd.to_datetime(date,…
MasterScrat
  • 7,090
  • 14
  • 48
  • 80
1
vote
1 answer

Find first date in string

I have a pdf file which i parsed using "pdfparser" plugin. From the text of the pages i need to find first date after a specific string (search string). I can find the search string and for date extraction i used date_parse($string) it extracts…
nOmi
  • 297
  • 3
  • 22