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

how to set microseconds timestamp #155

Closed
ronytigo opened this issue Jan 28, 2023 · 3 comments
Closed

how to set microseconds timestamp #155

ronytigo opened this issue Jan 28, 2023 · 3 comments

Comments

@ronytigo
Copy link

const std::chrono::time_point<std::chrono::system_clock> now = std::chrono::system_clock::now();
influx_client->write(influxdb::Point{"test"}.addField("value", 10).setTimestamp(time));

In influx I see the time in seconds resolution, how can I insert it in microseconds?

@offa offa added the question label Jan 28, 2023
@offa
Copy link
Owner

offa commented Jan 28, 2023

Changing the time resolution isn't supported yet (#86).

@offa offa closed this as completed Jan 28, 2023
@offa offa added the duplicate label Jan 28, 2023
@ronytigo
Copy link
Author

So the only resolution is seconds?

@offa
Copy link
Owner

offa commented Jan 28, 2023

The resolution internally is nanoseconds.

You can set more corse within that precision:

std::chrono::time_point<std::chrono::system_clock> t(std::chrono::milliseconds(123));
Point{…}.setTimestamp(t);

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

2 participants