How to Format Date and Time in Kusto Query | DateTime Format Function in Kusto

Topic: How to Format Date and Time in Kusto Query Language

In this article, we are going to learn about to format_date time functions so often we need to format the date and time according to our requirement maybe we want to create a report and export to excel and all that and we would like to export that date time specific formatKusto Query Language is a powerful tool to explore your data and discover patterns, identify anomalies and outliers, create statistical modeling, and more. The query uses schema entities that are organized in a hierarchy similar to SQL's: databases, tables, and columns.


 //format_datetime() -- Formats a datetime according to the provided format.  
 // This has alot of formats, check this out  
 //https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/format-datetimefunction  
 //Let's create a table Customer  
 //.drop table Customer  
 .create table Customer (CustomerId: long, FName: string,LName:string, Salary: int,hiredate:datetime)   
  .ingest inline into table Customer <|  
 1,Aamir,Shahzad,2000,2021-11-28T04:52:43.8745893Z  
 2,Raza,ALI,4000,2018-11-28T04:52:43.8745893Z  
 3,Lisa,Rivers,50000,2021-12-28T04:52:43.8745893Z  
 4,steve,Ladson,1000,2010-09-28T04:52:43.8745893Z  
 5,Robert,Jr,500,2015-01-20T04:52:43.8745893Z  
 6,aamir,ali,1000,2005-03-01T04:52:43.8745893Z  
 Customer  
 | extend   
 SampleFormat1=format_datetime(hiredate,'y-M-d')  
 ,SampleFormat2=format_datetime(hiredate,'yy-MM-dd')  
 ,SampleFormat3=format_datetime(hiredate,'yyyy:MM:dd')  
 ,SampleFormatTime=format_datetime(hiredate,'h:m:s')  

Video Demo: How to Format Date and Time in Kusto Query

3 comments:

  1. Get the best business assignment help online from a top-rated assignment expert. We have over ten years of assignment assistance experience. accounting essay assignment help offers all types of assignment assistance to college and university students. For all assignment help, our assignment helpers in uk guarantee on-time delivery and plagiarism-free content.

    ReplyDelete
  2. High School Students Searching for Rajasthan Board 6th, 7th, 8th, 9th class Previous Question Paper 2023 we have Attached the past few year Paper 2023s here go through the Details and Download those Paper 2023s you want. RBSE 6th Class Question Paper 2023 Start your Preparation with Rajasthan Board 6th, 7th, 8th, 9th Model Paper 2023 to get Qualified in Rajasthan Board High School Exam with more marks, Candidates are Advised to Practice Through Raj Board 6th, 7th, 8th, 9th Sample Paper 2023

    ReplyDelete
  3. Services where you can buy a case brief https://topwritingservice.com/buy-a-case-brief have yielded great results for many students struggling with the demands of legal studies. These professional services provide valuable assistance with summarizing and analyzing legal cases, ultimately helping students reduce stress and increase their chances of academic success.

    ReplyDelete