SOLVED

Why doesn't datetime(tostring(now())) work?

Microsoft

I ask b/c I am using parameters like

 

let start_time = datetime({startTime});
let end_time = datetime({endTime});

 

and since you don't support datetime(datetime) so I could pass, say, a startTime=now(),

 

I try to pass the tostring(now()) but that doesnt' work either.

 

What is the proper way to pass a parameter and construct a datetime out of the parameter value, if I am testiong in Kusto explorer and want to manually drive my query? The query must remain as-is, in accepting a datetime({startTime}) style as it is all throughout our team's parameterized queries in dashboards, etc.

1 Reply
best response confirmed by slavikn (Microsoft)
Solution

@dudeed , instead of datetime you should use todatetime - this works:

print todatetime(tostring(now()))

 

1 best response

Accepted Solutions
best response confirmed by slavikn (Microsoft)
Solution

@dudeed , instead of datetime you should use todatetime - this works:

print todatetime(tostring(now()))

 

View solution in original post