import datetime
from influxdb_client import InfluxDBClient, WritePrecision, Point
from influxdb_client.client.write_api import SYNCHRONOUS
def write_into_influxdb(points):
url = "xxx"
token = "xxx"
org = "xxx"
bucket = "xxx"
client = InfluxDBClient(url=url, token=token, org=org)
write_api = client.write_api(write_options=SYNCHRONOUS)
write_api.write(bucket=bucket, org=org, record=points)
print("Success")
client.close()
a = ('2024', '10', '17', '0', '0', '4')
write_into_influxdb(
Point("test")
.tag("test", "test")
.field("test", "test")
.time(datetime.datetime(
int(a[0]), int(a[1]), int(a[2]), int(a[3]), int(a[4]), int(a[5])
), WritePrecision.S)
)
i can’t see the new data in Data Explorer:
Maybe I used the wrong time format…who can help me