Date Formats in Queries

To search for dates, use a date range, [start date .. end date], or a specific date.

Examples

Query Finds
asset.lastBoot: [now-2M .. now-1M] Assets last booted between 1 and 2 months ago
asset.lastBoot: [2018-05-01 .. 2018-10-01] Assets last booted between May 1, 2018, and October 1, 2018
asset.lastBoot: [now-10d .. now-1s] Assets last booted between 10 days ago and 1 second ago
asset.lastBoot: [2018-10-01 .. 2018-10-03] Assets last booted between October 1, 2018, and October 3, 2018
asset.lastBoot: '2018-10-01' Assets last booted on October 1, 2018
asset.lastBoot: "2018-11-01 10:53:49" Assets last booted on November 1, 2018, at 10:53:49

Date Variables

Date variables help you define a date or date range. The supported formats include yyyy, yyyy-MM, and yyyy-MM-dd.

Format Query Finds Assets Last Updated
yyyyinventory.lastUpdated: "2017"Between January 1, 2017, and December 31, 2017
yyyy-MMinventory.lastUpdated: "2018-09"Between September 1, 2018, and September 30, 2018
yyyy-MM-ddinventory.lastUpdated: "2018-10-01"At any time on October 1, 2018
yyyy-MM-dd HHinventory.lastUpdated: "2018-07-15 10"On July 15, 2018, from 10:00 AM to 11:00 AM
yyyy-MM-dd HH:mminventory.lastUpdated: "2018-06-12 10:15"On June 12, 2018, at 10:15 AM
yyyy-MM-dd HH:mm:ssinventory.lastUpdated: "2018-09-11 10:15:44"On September 11, 2018, at 10:15:44 AM

The now Shortcut

Enter now-, followed by a number and a time unit: y (year), M (month), w (week), d (day), h (hour), m (minute), or s (second). For example:

  • now-1y: 1 year ago
  • now-2M: 2 months ago
  • now-5d: 5 days ago

Comparison Operators

You can use comparison operators in date searches. For example:

  • inventory.lastUpdated > 2018-10-12
  • inventory.lastUpdated >= 2018-10-12
  • inventory.lastUpdated < 2018-10-12
  • inventory.lastUpdated <= 2016-10-12

Related Topics

How to Search in CSAM

Search Tokens for IT Assets