Skip to content

DateTime.parseDateTimeString will create a non-sensical timestamp for 14-character epoch-like values that use more than one period #724

@ctiwald

Description

@ctiwald

Noticed this while mucking around with a tool that fronts the TSDB API (i.e. I was trying to clone TSDB's timestamp validation):

https://github.com/OpenTSDB/opentsdb/blob/master/src/utils/DateTime.java#L124-L129

That logic will incorrectly pass a 14-character timestamp that contains a . at the 10th character, but also contains another .:

1234567890.2.4

for example.

Notably, this will convert to "123456789024" on the '.' replace, rather than erroring as it should.

I'm happy to submit a patch for this, but thought I'd check first to see how much you all care :-).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions