influxdb-java icon indicating copy to clipboard operation
influxdb-java copied to clipboard

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

Open arjenzhou opened this issue 4 years ago • 2 comments

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 avatar Aug 28 '20 06:08 arjenzhou

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

arjenzhou avatar Aug 28 '20 06:08 arjenzhou

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

https://github.com/influxdata/influxdb-java/issues/440#issuecomment-483896165

arjenzhou avatar Aug 28 '20 15:08 arjenzhou