Convert sql date to flux uint

Hi everyone,

I retrieve some date information using flux from an sql database

the received date is in the following format
time = uint(v: “2020-04-29”)

error calling function “uint”: strconv.ParseUint: parsing “2020-04-29”:

if i remove the quotes it is working
time = uint(v: 2020-04-29)

but how can I convert the date string to uint?

Can someone give me a hand?

Hello @noltipolti,
I don’t think you can use uint() like that

> time

You might want to look into storing the timestamp in as a string in unix timestamp and/or using the toTime() instead?