Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove time part from a datetime in Kusto

If I've got a Kusto datetime and I want to remove the time portion, leaving just a date at midnight, what's the best way? I can do this

todatetime(format_datetime( now(), "yyyy-MM-dd"))

but surely there's a more efficient way?

like image 479
Rory Avatar asked Oct 31 '20 12:10

Rory


People also ask

How do you format a date in Azure?

The following ISO 8601 UTC formats are currently accepted by Azure Storage. The date value is required, while the time value is optional: YYYY-MM-DD. YYYY-MM-DDThh:mm<TZDSuffix>

What is extent in kusto?

Overview. Kusto is built to support tables with a huge number of records (rows) and large amounts of data. To handle such large tables, each table's data is divided into smaller "chunks" called data shards or extents (the two terms are synonymous). The union of all the table's extents holds the table's data.

How is kusto different from SQL?

In order to query the data, you use Kusto Querying Language (KQL). KQL is for querying only and unlike SQL, you can not update or delete data using KQL. You can also visualize your analysis through ADE either through the 'render' command in KQL or you can connect to PowerBI and output your findings that way.

Does kusto allow data update in place?

Updating single records isn't possible. You do have the option to update data in batches, by tagging it at ingestion time, and using shard-level commands (such as . replace extents) when you need to perform the 'update'.


Video Answer


1 Answers

Use the startofday() function:

startofday( now() )

or the bin() function:

bin( now(), 1d )
like image 85
Rory Avatar answered Oct 07 '22 08:10

Rory