---
title: DateTimeToCTime
slug: neurons-for-itsm/admin-user-help/enu/latest/datetimetoctime
createdAt: 2026-07-14T19:16:38.848Z
---

Takes a DateTime value and returns the C time that represents the same date and time.

In the C programming language, a date and time is a long integer number of seconds since midnight on 1/1/1970. It is a representation of a DateTime value used in the C programming language. This information is used in certain integrations.

## Syntax

`DateTimeToCTime(DTVal)`

## 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                                                                                        | Yes1   |
| 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)                              | Yes1   |
| Business Rules: Calculation Rules (Before Save or Always, with Recalculate On Load)                                      | Yes    |
| Business Rules: Editing Rules                                                                                            | Yes2   |
| Business Rules: Initialization Rules                                                                                     | Yes1   |
| Business Rules: Read Only Rules                                                                                          | No     |
| Business Rules: Required Rules                                                                                           | Yes2   |
| Business Rules: Validation Rules                                                                                         | Yes1   |
| Client Expressions                                                                                                       | No     |
| Object Permissions                                                                                                       | No     |
| Services                                                                                                                 | Yes    |
| LDAP                                                                                                                     | Yes    |
| Mobile                                                                                                                   | Yes    |
| Quick Actions (except UI Quick Actions)                                                                                  | Yes1   |
| UI Quick Actions                                                                                                         | No     |
| Reports                                                                                                                  | Yes1   |
| Search/Dashboard without field references                                                                                | Yes1   |
| Search/Dashboard with field references                                                                                   | No     |
| 1. Except in services.<br />2. Except in services and when this field appears on a form or is triggered by such a field. |        |

## Parameter

| Parameter | Description                                           |
| --------- | ----------------------------------------------------- |
| DTVal     | The DateTime value for which to calculate the C time. |

## Return Value

:::Paragraph{indent="1"}
64-bit integer
:::

## Example

`$(DateTimeToCTime("8/12/2015 at 2:01 PM"))`

:::Paragraph{indent="1"}
For the example above, returns the number of seconds between 1/1/1970 00:00 AM and 8/12/2015 at 2:01 PM, which is 1439413254.
:::
