Dates and Timestamps
Use a calendar tool to select an exact date, and a relative date picker to select a date that is relative to the current time.
There are two tools that Guardium provides to populate date fields: a calendar tool to select an exact date, and a relative date picker to select a date that is relative to the current time (now -1 day, for example). In addition, you can manually enter exact or relative dates.
Timestamps in Queries
Be careful when you include Timestamps in queries.
First, be aware of the distinction between a timestamp (lowercase t) and a Timestamp (uppercase T).
- A timestamp (lowercase t) is a data type containing a combined date-and-time value, which when printed displays in the format yyyy-mm-dd hh:mm:ss (for example, 2020-07-17 15:40:25). When you create or edit a query, most attributes with a timestamp data type display with a clock icon in the Entity List pane.
- A Timestamp (uppercase T) is an attribute that is defined in many entity types. It usually contains the time that the entity was last updated.
Including a Timestamp attribute value in a query produces a row for every value of the Timestamp, which can produce an excessive amount of output. Instead, use the count aggregator when including the Timestamp in a query, and then drill down on a report row to view the individual Timestamp values for the items included in that row only, in a drill-down report. See Aggregate Fields in Queries.
When displaying a Timestamp value in a query that contains Timestamp attributes in multiple entities, be careful to select the Timestamp attribute from the appropriate entity type for the report. For example, if the query displays information from both the client/server and the Session entities, with the Session selected as the main entity, you can display a Timestamp attribute from one or both entities. If you include the client/server Timestamp, you see the same value printed for every Session for a given client/server connection – always the time at which that particular client/server was last updated. If you include the Timestamp attribute from the Session, you see the time that each Session listed was last updated.
Select an Exact Date from Calendar
To use the Calendar Window to select an exact date:
- Click Calendar for the field where you want to insert a date. The
calendar opens in a separate window.
- Click the arrows to display the previous or next month in the calendar window.
- Click any date to select that day. The calendar window closes and the selected date is inserted
into the date field next to the calendar tool that you clicked.Note: The default time for a date that is selected from the calendar is always 00:00:00 (midnight). To specify a different time, enter the time that you want in 24-hour format: hh:mm:ss, where hh is the hour (0-23), and mm and ss are minutes and seconds (both 0-59).
Enter an Exact Date Manually
- Click the field where you want to enter the date and enter the date in YYYY-MM-DD format, where:
- YYYY is optional and can be any positive integer value. If omitted, YYYY defaults to the current year. If a one- or two-digit year is entered, the century portion of the date defaults to 19.
- MM is the month (1-12)
- DD is the day of the month (1 - 28, 29, 30, or 31, depending on the month)
- The default time for a date that is selected from the calendar is always 00:00:00 (midnight). To specify a different time, enter the time that you want in 24-hour format: hh:mm:ss, where hh is the hour (0-23), and mm and ss are minutes and seconds (both 0-59)..
yyyy-mm-dd
hh:mm:ss
.Select a Relative Date from Date Picker
Rather than specify an exact date, it is often more convenient to specify dates relative to
either the current date (now) or some other date (the first Monday, for example). For example, to
always include information from the previous seven days in a query, it's more convenient to define
relative dates (for example, start = now minus seven days
and end =
now
). The Relative Date Picker tool can be used to select a relative date for many types of
tasks.
- Click the Relative Date Picker next to any field where a relative date is allowed. The Relative Date Picker window opens.
- Select Now, Start, or End from the list. Depending on your choice, the display changes to provide for additional selections.
- From the middle list, select this, last, or
previous, which is relative to the unit (day, week, month, or day of the week
that is selected in the next list) as follows:
- This is the current unit.
- Last is the current unit minus one.
- Previous is current unit minus two.
- Select the day, week, month, or a specific day: Monday-Friday.
- Click Accept when you are done. The relative date is inserted into the field next to the Relative Date Picker button that you clicked.
Enter a Relative Date Manually
To enter a relative date manually, follow one of the procedures. The keywords are not case-sensitive but each component must be separated from the next by one or more spaces.
There are three general formats you can use to enter a relative date:
- NOW plus or minus a specified number of minutes, hours, days, weeks, or months.
- The Start or End of the current, last or previous day, week, or month.
- The Past or Previous day of the week (Sunday, Monday, Tuesday, and so on.).
Relative to NOW
- Click in the field where you want to enter the relative date. Depending on the application, you can either search for data in the past (such as from a report) or schedule an action in the future (to start a service).
- Enter the keyword NOW.
- To search for existing data, enter a minus sign and an integer to specify the relative time. To specify a future action, specify a plus sign and an integer.
- Specify one of the following keywords: HOUR, DAY, WEEK, or MONTH. Plurals (hours, days, etc.) are not allowed.
- To query data from a report for the last 12 hours, enter NOW -12 HOUR.
- To start an S-TAP installation via GIM in exactly one day, enter NOW +1 DAY.
Relative to a Day, Week or Month
- Click in the field where you want to enter the relative date.
- Enter the keywords START OF or END OF.
- Enter THIS or LAST, followed by DAY, WEEK, or MONTH. Example: end of last week
Relative to a Day of the Week
- Click in the field where you want to enter the relative date.
- Enter the keywords START OF or END OF.
- Enter LAST or PREVIOUS, followed by SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, or SATURDAY. Example: start of previous Tuesday