Home

How to enter dates in your queries

To search for dates you'll use a date range [start date .. end date] or a specific date or a year.

Date variables

Date variables help you define a date or a date range you're interested in. We support the following date formats: yyyy, yyyy-MM, yyyy-MM-dd.

Find assets with deployment job started between January 1st 2020 and December 31st 2020 (i.e. yyyy)

startDateTime: "2020"

Find assets with deployment job started between 01 November 2020 and 30 November 2020 (i.e. yyyy-MM)

startDateTime: "2020-11"

Find assets with deployment job started anytime on November 1st 2020 (i.e. yyyy-MM-dd)

startDateTime: "2020-11-01"

Find assets with deployment job started on November 1st 2020 from 10 to 11am (i.e. yyyy-MM-dd HH)

startDateTime: "2020-11-01 10"

Find assets with deployment job started on November 1st 2020 at 10:15 A.M. (i.e. yyyy-MM-dd HH:mm)

startDateTime: "2020-11-01 10:15"

Find assets with deployment job started on November 1st 2020 at 10:15:44am (i.e. yyyy-MM-dd HH:mm:ss)

startDateTime: "2020-11-01 10:15:44"

Use the "now" shortcut

Type now- followed by a number and any of the following time units: y (year), M (month), w (week), d (day), h (hour), m (minute), s (second)

now-1y for 1 year ago

now-2M for 2 months ago

now-5d for 5 days ago

Comparison operators

We support comparison operators in your date searches.

endDateTime > 2020-10-12

endDateTime >= 2020-10-12

endDateTime < 2020-10-12

endDateTime <= 2020-10-12

Examples

Find assets with patches installed between 1-2 months ago

installedDate: [now-2M .. now-1M]

Find assets with patches installed between January 1st and April 1st 2020

installedDate: [2020-01-01 .. 2020-04-01]

Find assets with patches installed within last 10 days.

installedDate>=now-10d   (The result includes patches installed on day 10.)

installedDate>now-10d   (The result excludes patches installed on day 10.)

Find assets with patches installed between 2020-10-01 and 2020-10-03

installedDate: [2020-10-01 .. 2020-10-03]

Find assets with patches installed on November 1st 2020

installedDate: '2020-11-01'

Find assets with patches installed on November 1st 2020 at time 10:53:49

installedDate: "2020-11-01 10:53:49"

Find the agents that last checked in to the Qualys platform before the last 30 days.

lastCheckedIn<now-30d

Note: In this case, don't use the NOT operator in your range search to form a query NOT lastCheckedIn:[now-30d...now-2s].

See Avoid Usage of NOT.