influxdata / influxdata/influxdb-java

Is there a way to get QueryResult like 'yyyy-MM-dd HH:mm:ss'?

Open
#698 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.2k
Forks
469
PR merge metrics
No merged PRs in 30d

Description

Presently the time format of queryResult of rfc3339 is something like `yyyy-MM-dd'T'HH:mm:ssX`, which I excepted was `yyyy-MM-dd HH:mm:ss` like https://docs.influxdata.com/influxdb/v1.8/query_language/explore-data/#rfc3339-like-date-time-string.

Using SimpleDateFormat needs two-time converting

```Java
SimpleDateFormat inputSdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");
SimpleDateFormat outputSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date parse = inputSdf.parse(dateStr);
String format = outputSdf.format(parse);
```

Is there a way to get like that?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing QueryResult date handling and the Java SimpleDateFormat example in the issue. Determine whether the client can expose the requested `yyyy-MM-dd HH:mm:ss` representation without the caller performing two conversions; done means the supported approach or resulting format is documented and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.