---
sourceDocument: Australia Sales Customer Relationship Management
sourceDocumentLink: https://www.servicenow.com/docs/r/australia/order-management

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Sales Customer Relationship Management

ft:clusterId :

    - omgmt

bundleId :

    - omgmt

workflow :

    - Customer and Industry


---

# Date and time field fields

# Date and time field fields {#ariaid-title1}

Release version: Australia  
Updated May 7, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Date and time field fields

Date and time fields in ServiceNow CPQ play crucial roles in quoting processes, primarily for calculating contract terms and auditing quote-related events.
Accurate handling of these fields ensures correct term calculations like contract start/end dates and renewal periods, while also supporting audit trails for activities such as quote creation and approvals.
Missing or null date values can impact these functions and should be flagged or managed using system defaults or error messages.
Show full answer Show less  

## Date and time formats

ServiceNow Quote Experience supports specific date and time formats, storing all values in Coordinated Universal Time (UTC) to prevent time zone inconsistencies. Administrators can configure fields to display either just the date or both date and time components:

* **Date only:** Format YYYY-MM-DD (e.g., 2024-11-07), time-zone agnostic
* **Date and time:** Format YYYY-MM-DDTHH:MM:SS (e.g., 2024-10-22T14:30:00) stored in UTC

## Handling null and blank date values

Blank or null date values in rules and scripts compare as false unless directly compared to another blank value. The default date field is null unless otherwise set. This behavior impacts how conditions and scripts evaluate date fields, so proper handling is necessary to avoid logic errors.

## Supported comparison operators

Comparison operators for date/time fields include \<, \<=, \>, \>=, =, and !=. Operators involving blank or null operands generally evaluate to false, except "=" which returns true only when both operands are blank. Understanding these rules helps in writing accurate Quote Experience rules and scripts.

## Aggregate functions

Aggregate functions supported for date fields include:

* **Max:** Returns the latest date
* **Min:** Returns the earliest date
* **Count:** Counts non-empty dates

Sum and Avg are not applicable to date fields and should be avoided to prevent errors.

## Date calculation example

An example script demonstrates calculating the difference between two dates in months and days, returning a precise subscription term. This pattern can be used in determination rules to derive summary fields from date inputs, enabling dynamic contract term calculations.

## Practical application for ServiceNow customers

By understanding the behavior, formats, and supported operations on date and time fields in ServiceNow CPQ, customers can:

* Ensure accurate contract term calculations and renewals
* Maintain reliable audit trails for quote activities
* Write robust rules and scripts that correctly handle blank or null dates
* Utilize aggregate functions to summarize date data across transactions
* Implement custom calculations for subscription terms using provided scripting patterns  
Reference for how date and time fields behave in ServiceNow CPQ
ServiceNow Quote Experience rules and scripts, including comparison operators, null handling, and supported aggregate functions.

## Date and time fields in quoting {#quote-tm-date-time-field-behavior__overview}

Date and time fields in ServiceNow CPQ serve two primary purposes in a quoting context.

Term calculations
:   Calculate contract terms, start and end dates, renewal dates, and subscription lengths. Blank or null date values can affect term accuracy --- use system defaults such as the current date, or flag missing values using error
    messages in rules.

Audit events
:   Track activities such as quote creation, pricing changes, and approval events. Missing dates indicate incomplete data and should be flagged for review.

## Date and time formats {#quote-tm-date-time-field-behavior__formats}

ServiceNow Quote Experience supports the following date and time formats.
{#quote-tm-date-time-field-behavior__formats__entry__3}

| Format type | Format pattern | Example |
|-|-|-|
| Date only | `YYYY-MM-DD` | `2024-11-07` |
| Date and time | `YYYY-MM-DDTHH:MM:SS` | `2024-10-22T14:30:00` |
| UTC (stored format) | `YYYY-MM-DDTHH:MM:SSZ` | `2024-10-22T14:30:00Z` |
[Table 1. Date and time field formats]

Date-only fields are time-zone agnostic. All date and time values are stored in Coordinated Universal Time (UTC) to avoid time-zone discrepancies. Administrators can choose whether to include the time component when configuring a
date/time field.

In the ServiceNow Quote Experience layout, the field type value that controls display behavior is:

* `"type":"Date"` --- displays only the date component.
* `"type":"DateTime"` --- displays both date and time components.

## Null and blank date behavior in scripts {#quote-tm-date-time-field-behavior__null-blank-behavior}

Blank and null date values follow specific comparison rules in ServiceNow Quote Experience scripts and rule conditions.

* Blank/null dates compare as `false` unless compared directly to another blank value.
* The default value of a date field is empty (null) unless a default is specified in the field configuration.

The following examples show blank date comparison outcomes.
{#quote-tm-date-time-field-behavior__null-blank-behavior__entry__3}

| Expression | Result | Explanation |
|-|-|-|
| `date123 = ""` | `true` | A blank date compared to a blank string evaluates to true. |
| `date123 != ""` | `false` | A blank date compared as not-equal to blank evaluates to false. |
[Table 2. Blank date comparison examples]

## Supported comparison operators {#quote-tm-date-time-field-behavior__comparison-operators}

The following comparison operators are supported for date and time field values in rule conditions and scripts.
{#quote-tm-date-time-field-behavior__comparison-operators__entry__2}

| Operator | Behavior |
|-|-|
| `<` | Less than. Always evaluates to `false` when either operand is blank or null. |
| `<=` | Less than or equal to. Always evaluates to `false` when either operand is blank or null. |
| `>` | Greater than. Always evaluates to `false` when either operand is blank or null. |
| `>=` | Greater than or equal to. Always evaluates to `false` when either operand is blank or null. |
| `=` | Equal to. Evaluates to `true` only when both operands are blank. |
| `!=` | Not equal to. Evaluates to `false` when either operand is blank or null. |
[Table 3. Date comparison operators]

## Aggregate functions for date fields {#quote-tm-date-time-field-behavior__aggregate-functions}

The following aggregate functions are supported for date field values. Use these in determination rule scripts to calculate date values across transaction lines.
{#quote-tm-date-time-field-behavior__aggregate-functions__entry__3}

| Function | Behavior | Notes |
|-|-|-|
| `Max` | Returns the latest date in the set. | Supported. |
| `Min` | Returns the earliest date in the set. | Supported. |
| `Count` | Counts non-empty date values in the set. | Supported. |
| `Sum` | Not applicable to date values. | Not recommended --- may trigger compile-time errors. |
| `Avg` | Not applicable to date values. | Not recommended --- may trigger compile-time errors. |
[Table 4. Supported aggregate functions for date fields]

## Date calculation script example {#quote-tm-date-time-field-behavior__date-calc-example}

The following script calculates the difference between a start date and an end date in months and days, and stores the result in a subscription term field. Use this pattern in a determination rule action to populate a summary field
from two date inputs.

    // Calculates the difference between start and end dates in months and
    // days. Stores the result in Subscription Term (Months).

    var yearsDiff =
      txn.custom.endDate.getFullYear() - txn.custom.startDate.getFullYear();
    var monthsDiff =
      txn.custom.endDate.getMonth() - txn.custom.startDate.getMonth();
    var totalMonths = yearsDiff * 12 + monthsDiff;

    var startDay = txn.custom.startDate.getDate();
    var endDay = txn.custom.endDate.getDate();
    var daysInMonth = new Date(
      txn.custom.endDate.getFullYear(),
      txn.custom.endDate.getMonth() + 1,
      0
    ).getDate();
    var dayFraction = (endDay - startDay + 1) / daysInMonth;

    totalMonths += dayFraction;
    return Math.floor(totalMonths * 1000) / 1000;

**Related concepts**   

* [Quote transaction fields](https://www.servicenow.com/docs/HvOcEMg~gZcYfzJjjvHxCg "ServiceNow Quote Experience supports five field types at two levels —transaction (header) and transaction line —enabling administrators to capture all required quote data in ServiceNow CPQ.")  
**Related tasks**   

* [Create a transaction field](https://www.servicenow.com/docs/hjB0EwgSLSUoGcllOlTmPg "Create a custom field in ServiceNow Quote Experience to capture additional data at the transaction (header) level or the transaction line level in ServiceNow CPQ.")  
**Related reference**   

* [Transaction-level system fields](https://www.servicenow.com/docs/BC0xXECkN4m3zlEf9qaZHA "Reference for the system-provided fields at the transaction (header) level in Quote Experience, including variable names, descriptions, who can modify each field, and default values.")
* [Transaction line-level system fields](https://www.servicenow.com/docs/ZWhGhmmaArtPe9IB3TrGCw "Reference for the system-provided fields at the transaction line level in ServiceNow CPQ ServiceNow Quote Experience, including variable names, descriptions, who can modify each field, and default values.")

