Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSVSaveService does not handle date parsing very well #3041

Closed
asfimport opened this issue Jan 22, 2013 · 2 comments
Closed

CSVSaveService does not handle date parsing very well #3041

asfimport opened this issue Jan 22, 2013 · 2 comments

Comments

@asfimport
Copy link
Collaborator

Sebb (Bug 54459):
CSVSaveService defaults to using
DEFAULT_DATE_FORMAT_STRING = "MM/dd/yy HH:mm:ss"
if the date does not parse as milliseconds.

This is not very helpful:

  • it does not correspond with the suggested default in jmeter.properties, which is now yyyy/MM/dd HH:mm:ss.SSS
  • the code does not check that the format actually works.

It would be a lot better if the format were at least checked to see if it worked before proceeding to use it.

Also it ought to be possible to compare the date field with some common formats and select one that works.

Likely input formats include:
yyyy/MM/dd HH:mm:ss[.SSS]
yyyy-MM-dd HH:mm:ss[.SSS]
yyyyMMdd HH:mm:ss[.SSS]

All the above should be easy to detect unambiguously.

However, if the file uses MM/dd/yy HH:mm:ss (US format) as per the current code, it won't in general be possible to distinguish it from dd/MM/yy HH:mm:ss (as used in Europe).

In this case, the format would need to be provided as a property.

Severity: normal
OS: Windows XP

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
(In reply to comment 0)

  • the code does not check that the format actually works.

Not strictly true: it does check that the format parses the timestamp.
However, the created DateFormat instance is lenient, and may match only part of the timestamp string.

For example, MM/dd/yy HH:mm:ss happily matches 2013/01/19 20:55:07 but parses it as 1 Sep 2186 19:55:07 GMT.

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
URL: http://svn.apache.org/viewvc?rev=1436725&view=rev
Log:
CSVSaveService does not handle date parsing very well
#3041

Modified:
jmeter/trunk/src/core/org/apache/jmeter/save/CSVSaveService.java
jmeter/trunk/xdocs/changes.xml
jmeter/trunk/xdocs/usermanual/listeners.xml

Did not implement the following formats:
yyyyMMdd HH:mm:ss[.SSS]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant