---
title: IsValidDateTime
slug: neurons-for-itsm/admin-user-help/enu/latest/isvaliddatetime
createdAt: 2026-07-14T19:16:38.180Z
---

Returns a boolean, the value of which is determined by whether a given date/time value is a valid or invalid UTC date/time. An optional parameter can be included to check if the date/time is in an Hours of Operation calendar, for example you may want to check if the given date is a working day, and the time is within working hours.

## Syntax

IsValidDateTime()

## Enabled For

For a description of the business object categories, see [Notes on "Enabled For"](docId\:u26v9feCFs6iLwA0-PVJd).

| Business Object Category                                                                    | Yes/No |
| ------------------------------------------------------------------------------------------- | ------ |
| Business Rules: Before-Save Rules                                                           | Yes    |
| Business Rules: Calculation Rules (After Save, with or without Also Recalculate on Load)    | Yes    |
| Business Rules: Calculation Rules (Before Save or Always, without Also Recalculate On Load) | Yes    |
| Business Rules: Calculation Rules (Before Save or Always, with Recalculate On Load)         | Yes    |
| Business Rules: Editing Rules                                                               | Yes    |
| Business Rules: Initialization Rules                                                        | Yes    |
| Business Rules: Read Only Rules                                                             | Yes    |
| Business Rules: Required Rules                                                              | Yes    |
| Business Rules: Validation Rules                                                            | Yes    |
| Client Expressions                                                                          | No     |
| Object Permissions                                                                          | No     |
| Services                                                                                    | No     |
| LDAP                                                                                        | No     |
| Mobile                                                                                      | No     |
| Quick Actions (except UI Quick Actions)                                                     | Yes    |
| UI Quick Actions                                                                            | No     |
| Reports                                                                                     | Yes    |
| Search/Dashboard without field references                                                   | No     |
| Search/Dashboard with field references                                                      | No     |

## Parameters

| Parameter   | Description                                                              |
| ----------- | ------------------------------------------------------------------------ |
| utcDateTime | Date/time that must be in UTC. The date/time you want to check is valid. |
| hopIdOrName | (Optional) The name or the ID of an Hours of Operation calendar.         |

## Return Value

:::Paragraph{indent="1"}
Boolean value.
:::

:::Paragraph{indent="1"}
If the **utcDateTime** parameter is valid the function returns True, otherwise False if invalid.
:::

:::Paragraph{indent="1"}
If the **hopIdOrName** parameter is included and the date/time is valid for the calendar (the date falls into a date and the working hours in the calendar), then the function returns True, otherwise False if invalid (the date does not fall into a date in the calendar, and/or the time is not within working hours).
:::

## Example

$(IsValidDate(2022-05-07 12:24))

:::Paragraph{indent="1"}
If 2022-05-07 12:24 is a valid UTC date/time the returned value is True.
:::

`$(IsValidDate(2022-05-07, "Weekday Working"))`

:::Paragraph{indent="1"}
If 2022-05-07 12:24 is a valid UTC date/time and this date/time is in an Hours of Operation calendar named "Weekday Working", the returned value is True, otherwise False if not in the calendar, or the date/time is not a valid UTC date/time.
:::
