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

Adapt a date string into another format

I am pulling a filename and modified date from a directory. I am having to format the date as ymd h:i so that I can sort the array in date order using the array_multisort. I wish to then reformat date from ymd h:i to d/m/y h:i; so 140428 11:54 would…
syme89
  • 3
  • 2
0
votes
5 answers

How to convert date formats?

So I have this String: "Tue Apr 15 00:00:00 IDT 2014" or "Apr 15 2014" after I change it by split it. And I want to convert it to this format: "yyyy-MM-dd" but when I i get this message: java.text.ParseException: Unparseable date: "Apr 15…
Dor Cohen
  • 117
  • 1
  • 4
  • 10
0
votes
5 answers

Selecting a date range in SQL without a DATE field

I have a MySQL database containing a year field and a week_number field. These are simply INT fields. I'd like to be able to execute a query to select between an inclusive range of dates based on week numbers and years, so for example: SELECT * FROM…
kfb
  • 6,252
  • 6
  • 40
  • 51
0
votes
1 answer

scanning in 2 different types of inputs for a date

I have a perfectly working code that is able to tell me what day of the week it is when i input a certain date, however i am stuck as to how to take in the inputs. I have to be able to take in both of these inputs in the…
user3473994
  • 41
  • 1
  • 3
  • 8
0
votes
2 answers

What is the correct date parser format string for the ISO date format?

I am trying to parse dates in the ISO date format, but for reasons I don't understand, the pattern I am using isn't working. From the shell: >>> s datetime.date(2014, 1, 3) >>> str(s) '2014-01-03' >>>…
Marco Dinatsoli
  • 10,322
  • 37
  • 139
  • 253
0
votes
6 answers

Error parsing date string

I need to parse this string as a date: Mon Jun 10 00:00:00 CEST 2013 Here is what I do: SimpleDateFormat sdf = new SimpleDateFormat("ccc MMM dd HH:mm:ss z yyyy"); Date date = sdf.parse(dateString); But I get a ParseException: Unparseable date:…
Daniele Vitali
  • 3,848
  • 8
  • 48
  • 71
0
votes
1 answer

SimpleDateFormat crashes when I change my display time

I have an application that uses SimpleDateFormat to parse dates. I suddenly had the urge to change my computer's display time format to a Chinese format and then left it at that to do something else. When I went back to run my application several…
MxLDevs
  • 19,048
  • 36
  • 123
  • 194
0
votes
1 answer

Parsing a date string containing a 'T' and + time zone offset

I need to check on dates for certain items. I'm reading a string from a JSON file that looks like: "revisionDate":"2013-08-28T13:07:53+00:00" When I try to format it NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; [dateFormat…
easythrees
  • 1,530
  • 3
  • 16
  • 43
0
votes
1 answer

Safari subtracts 1 day from dates before 1300

> new Date("1300-01-01").toISOString() < "1299-12-31T00:00:00.000Z" > new Date("1301-01-01").toISOString() < "1301-01-01T00:00:00.000Z" Safari Version 6.1 (8537.71) Mac OS X 10.8.5 Couldn't find any upstream information
0
votes
1 answer

Java jackson configuration date

I am using jackson configurator to serialize - deserialize date. I am using this SerializationConfig serConfig = mapper.getSerializationConfig(); serConfig.setDateFormat(new SimpleDateFormat("MM/dd/yyyy HH:mm:ss z")); DeserializationConfig…
Akshay
  • 3,558
  • 4
  • 43
  • 77
0
votes
6 answers

23/12/2013 is mapping with MM/dd/yyyy format why, why not ParseException

Can anybody help? public void dateCalender() throws ParseException{ System.out.println(new SimpleDateFormat("MM/dd/yyyy", Locale.ENGLISH).parse("120/12/2013").toString()); //OUTPUT (Unexpected): Mon Dec 12 00:00:00 IST 2022 …
Rupesh
  • 2,627
  • 1
  • 28
  • 42
0
votes
1 answer

How to parse time when I don't know the exact format? 12h or 24h

I am looking for a library that can parse time from given user input. Proper time formats are: hh:mm, BUT optionally it could be AM or PM at the end to specify if it is 12h or 24h format. The result I want to achieve is to get the time and merge it…
mbudnik
  • 2,087
  • 15
  • 34
0
votes
5 answers

String conversion into DateTime

I have a joda DateTime value stored in mysql as String. But when I try to get this string from mysql table, its format changes and when I try to convert this string into DateTime, it throws:- IllegalArgumentException: Invalid format: "2012-10-04…
vikas27
  • 563
  • 5
  • 14
  • 36
0
votes
2 answers

parse the following string to year, month, date, hourOfDay, minute, second

How can i parse the following string 2000-05-12T12:00 to year, month, date, hourOfDay, minute, second? I know to parse split it in "-" but there is efficient way to date for all the value? I saw the solution like SimpleDateFormat parserSDF=new…
James Berners
  • 103
  • 2
  • 11
0
votes
3 answers

How to compare two DATETIMEs from MySQL

I want to limit my users to only (be able to) post something every 15 minutes. So in my SQL query I select NOW() to get the current date and time, and also the user's last post date date_added. I want to compare the two dates and if the difference…
James F
  • 554
  • 1
  • 9
  • 19