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

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

Open
arjenzhou opened this issue Aug 28, 2020 · 2 comments
Open

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

arjenzhou opened this issue Aug 28, 2020 · 2 comments

Comments

@arjenzhou
Copy link
Contributor

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

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?

@arjenzhou
Copy link
Contributor Author

In addition, how can I get result like 1.4252832E9 to be a plain number with no converting?

@arjenzhou
Copy link
Contributor Author

In addition, how can I get result like 1.4252832E9 to be a plain number with no converting?

#440 (comment)

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

No branches or pull requests

1 participant