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

d3.js parsing date error with csv file

I have a problem with parsing dates in a csv file. Have been looking for hours online and in books and testing, without finding the solution. Perhaps someone can help. The code works fine for reading a file with parsing just numbers. But when…
user2992220
  • 1,092
  • 1
  • 12
  • 20
2
votes
2 answers

Use variable in re.sub, for Python parsing multiple datetime-format strings?

I'm trying to come up with a function to translate various human date/time-format strings to Python compatible ones (from '*yyyy-MMM-dd*' to '*%Y-%b-%d*'). So far I built the translate dictionary below (a list of tuples…
Click2Death
  • 736
  • 1
  • 5
  • 18
2
votes
1 answer

Java SimpleDateFormat parsing irregularities

I'm doing some date parsing in Java and am encountering some weird behavior. I have a date string such as follows: String s = "Sun Aug 11 2013 11:00:00 -0700 (Pacific Daylight Time)" I'm trying to parse it into a date object like…
Onite
  • 392
  • 1
  • 7
2
votes
3 answers

Having trouble converting string (parsed from JSON) into javascript date object

I am trying to create javasscript date object in the following way var object = {"name":"Bay Area Global Health Film Festival","start_time":"2013-07-08T19:00:00","end_time":"2013-07-08T23:45:00","timezone":"America/Los_Angeles","location":"San…
Ben Pearce
  • 6,884
  • 18
  • 70
  • 127
2
votes
2 answers

Parsing a string to a date in Ruby

I know this sounds like a repeated question but I think this situation is different. I will delete this post if it truly is. I have a string containing a date in the following format: Thu, Jun. 20 I would like to parse this into a Date variable and…
megan
  • 305
  • 1
  • 6
  • 18
2
votes
2 answers

parsing a date string from FTPClient.getModificationTime()

I am trying to parse a date string which is a modification date of a file on FTP server. Following is the code. String dateString = mFTPClient.getModificationTime(PDF_FILE_NAME_PS); SimpleDateFormat dateFormat = new…
user1554693
  • 125
  • 1
  • 12
2
votes
1 answer

Parsing date by multiple formats with pivotYear set up for 2 digit years

I am having trouble to implement "simple" parsing of a date. The requirement is to allow enter year in two or four digits. When two digits are entered then make the split date for deciding into what century it belongs the first of January next year.…
Tomas Babic
  • 269
  • 5
  • 14
2
votes
3 answers

Make java.text.DateFormat parse to java.util.Calendar

Usually, I was doing it like this: DateFormat f = new SimpleDateFormat("yyyy-MM-dd"); Date d = f.parse("2012-12-21"); Calendar c = Calendar.getInstance(); c.setTime(d); bean.setDate(c); But I just found that working solution: DateFormat f = new…
sp00m
  • 47,968
  • 31
  • 142
  • 252
2
votes
1 answer

Is there a way to check if a string contains a date of unknown format?

In Python, Is there a way to definitively check if a string contains a date.? It would be preferable if it could catch any date format, but, if not, could it catch the %B-%w-%Y format.
ceradon
  • 73
  • 1
  • 8
2
votes
3 answers

Pandas: Converting Timestamp and Milliseconds to DatetimeIndex

With df = read_csv('data\query.csv') I'am getting: TIMESTAMP MILLISECONDS PRICE 0 15.10.2012 08:00:06 350 24.6 1 15.10.2012 08:00:06 630 24.7 2 15.10.2012 08:00:06 640 24.9 3 15.10.2012 08:00:06 650 …
user1766682
  • 400
  • 3
  • 14
2
votes
3 answers

Java DateFormat returning incorrect Date

I am trying to parse a date with a SimpleDateFormat and I encountered a strange behavior. This Example prints "Sun Jan 01 19:00:32 CET 2012" on my machine: import java.text.ParseException; import java.text.SimpleDateFormat; import…
mercutio
  • 1,065
  • 7
  • 18
2
votes
3 answers

java date pattern for timezone without ":"

I will work with third party API. They accept a date pattern like: 2012-02-15T17:34:37.937-0600 I know the pattern should be match like yyyy-MM-ddTHH:mm:ss.s But I am not sure how to represent the last "-0600" timezone? I think the standard…
ttt
  • 3,934
  • 8
  • 46
  • 85
1
vote
1 answer

JavaScript's Datejs library will not parse its own ISO format string

Javascript's Datejs library does not seem to want to parse its own ISO Format string: Date.parse((new Date()).toISOString ( )) // Result is null Is there another way I should be doing this?
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258
1
vote
3 answers

Daily counts with TSQL?

I have a site where I record client metrics in a SQL Server 2008 db on every link clicked. I have already written the query to get the daily total clicks, however I want to find out how many times the user clicked within a given timespan (ie.…
ElHaix
  • 12,846
  • 27
  • 115
  • 203
1
vote
2 answers

Why DOB logging every time whether updated or not during update API in Java?

I am logging fields which will be update during update API call. But getting DOB field every time whether it is updating or not DOB is of Date type private Date DOB; Logging DOB VALUE when passing this in payload { "DOB": "1990-01-01"} dob: Mon Jan…
dracile
  • 59
  • 6