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.

Note: When you select or enter dates, the date on the system on which you are running your browser might not be the same as the date on the Guardium® appliance to which you are connected.

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.

Tip: If your report displays the same times when you expect them to be different, the report probably includes a Timestamp attribute from an entity too high in the entity hierarchy for the level of detail you want on the report.

Select an Exact Date from Calendar

To use the Calendar Window to select an exact date:

  1. 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.
  2. 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

  1. 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)
  2. 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)..
Note: Some APIs accept dates or timestamps. In these cases, the format is always 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.

  1. Click the Relative Date Picker next to any field where a relative date is allowed. The Relative Date Picker window opens.
  2. Select Now, Start, or End from the list. Depending on your choice, the display changes to provide for additional selections.
  3. 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.
  4. Select the day, week, month, or a specific day: Monday-Friday.
  5. 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

  1. 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).
  2. Enter the keyword NOW.
  3. 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. 
  4. Specify one of the following keywords: HOUR, DAY, WEEK, or MONTH. Plurals (hours, days, etc.) are not allowed.
Examples:
  • 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.
Note: Some APIs also accept relative dates. Enter the relative date as, for example, NOW +3 DAY or NOW -12 HOUR. For APIs, the text is case-sensitive.

Relative to a Day, Week or Month

  1. Click in the field where you want to enter the relative date.
  2. Enter the keywords START OF or END OF.
  3. Enter THIS or LAST, followed by DAY, WEEK, or MONTH. Example: end of last week

Relative to a Day of the Week

  1. Click in the field where you want to enter the relative date.
  2. Enter the keywords START OF or END OF.
  3. Enter LAST or PREVIOUS, followed by SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, or SATURDAY. Example: start of previous Tuesday