---
schema_version: "1"
id: 51ad9709e6a1a7333c80242777033e303ed0d8de5d6c7c27cf40374fa1c2cd5b
title: Considerations for the Time Custom Field Type
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/custom_field_time_overview.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.custom_field_time_overview.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: c958fe213352553d1b361c525b8586e6cdcf7e811dab86c35231a23c4fabebe0
description: Track time, unbound to a date, with the Time custom field type, which is useful for time management, event planning, and project management.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Considerations for the Time Custom Field Type

Track time, unbound to a date, with the Time custom field type, which is useful for time management, event planning, and project management.

You can select the Time field type when you create a custom field. The Time type is a timestamp without the date included. A Time field value’s precision is in milliseconds. A date/time field value’s precision is in seconds. Use the time field type when you require a time of day that isn’t specific to a single date. For example, use it to show business hours, or if you want to compare times of day to calculate a duration.

## Time Field Behavior

Time field values follow these behaviors.

- In formulas, get a time value from the `TIMEVALUE` function. Use `TIMENOW`, `HOUR`, `MINUTE`, `SECOND`, and `MILLISECOND` functions with time in formulas.
- The Time field type is represented in Metadata API as a FieldType enumeration value.
- A time field value is saved according to the saving user’s time zone. When the time value is displayed in Salesforce, the value matches what’s saved. It isn’t converted to a user’s local time zone per the user’s Locale setting on the Language & Time Zone page.
- The stored time value is appended with a “Z”, but the time isn’t UTC, it's the time of the saving user's time zone. When you query a time field value using SOQL or the API, disregard the appended “Z.” For example, a user saves the time, which is 7:00 AM in their time zone. When you query the time via SOQL or the API 07:00:00.000Z is returned.
- The time is saved in a 24-hour format. For example, 07:00:00.000Z is 7:00 AM, and 19:00:00.000Z is 7:00 PM.
- The unit for adding or subtracting a time value is milliseconds. For example, Timefield1\_\_c has the value “5:00pm.”
    
    - Timefield1\_\_c + 600000 is “5:10pm”
    - Timefield1\_\_c - 600000 is “4:50pm”
    
    Time fields don’t include a date. So, adding 25 hours to a time value is the same as adding one hour. The clock restarts after 24 hours.
- You can subtract one time field from another in a formula. The result is in milliseconds. For example, TimeField1\_\_c has the value “10:00pm” and TimeField2\_\_c has the value “9:00pm”:
    
    - TimeField1\_\_c - TimeField2\_\_c is 3600000
    
    The result is never a negative number. Subtraction is the difference between two time values, using a 24-hour clock. For example, when calculating the number of hours that a business is open, you use this formula: `(ClosedTime - OpenTime) / 3600000`.
    
    - `ClosedTime` = 5 PM, `OpenTime` = 8 AM, `ClosedTime - OpenTime` = 9 hours
    - `ClosedTime` = 5 AM, `OpenTime` = 7 AM, `ClosedTime - OpenTime` = 22 hours
- In formula expressions, use the international date format (ISO) for text arguments. For example, use TIMEVALUE("11:30:00.000") instead of TIMEVALUE("11:30 AM").

## Time Field Limitations

Be aware of these limitations when using a field created from the Time field type. The time field:

- Isn’t supported in Process Builder, and Schema Builder
- Doesn't support the creation of custom index for SOQL queries
- Isn’t available for standard lookup relationships in external objects

## Formatting Time Fields in Salesforce Classic

In Salesforce Classic, you have several formatting options when you set a time value. For example, you can set a time value to include seconds, milliseconds, time zone, and use 24-hour notation.

- The time custom field type can use 24-hour notation. You can save a time value in HH:MM, for example, 14:40.
- Time fields support the following input formats.
    
     
    | Format | Example |
    | --- | --- |
    | hh:mm:ss aa | 10:30:25 AM |
    | hh:mm:ss.SSS a | 10:30:25.125 AM |
    | HH:mm:ss.SSS | 14:30:25.125 |
    | HH:mm:ss.SSSZ | 14:30:25.125Z displays as GMT |
    | hh:mm a | 10:30 AM |
    | hh:mma | 10:30AM |
    | h a | 4 PM |
    | ha | 4PM |
    | H:mm | 1:23 is 1:23 AM |
    | H | 14 is 2:00 PM |
    | Hmm | 123 is 1:23 AM |
    | HHmm | 1434 is 2:34 PM |
    
    h= Hour of day (1-12), H = Hour of day (0-23), m= minute, s= seconds, S= milliseconds, a= AM or PM, Z= GMT time zone.
- Use the 11:30:00.000Z format when loading values with Data Loader.
- Use the HH:MM:SS.MS format to set a default value for a field, such as `TIMEVALUE("10:30:00.000")` for 10:30 AM.

#### See Also

- [Create a Custom Field](https://help.salesforce.com/s/articleView?id=platform.adding_fields.htm&release=264.0.0&type=5 "Capture your unique business data by storing it in custom fields. When you create a custom field, you configure where you want it to appear and optionally control security at the field level.")
- [Locales Overview](https://help.salesforce.com/s/articleView?id=xcloud.admin_locales_overview.htm&type=5&language=en_US)
- [Formula Operators and Functions by Context](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5 "Use these operators and functions when building formulas. All functions are available everywhere that you can include a formula, such as formula fields, validation rules, approval processes, and workflow rules, unless otherwise specified.")
- [Using Date, Date/Time, and Time Values in Formulas](https://help.salesforce.com/s/articleView?id=platform.formula_using_date_datetime.htm&release=264.0.0&type=5 "Use Date, Date/Time, and Time values in formulas to manage payment deadlines, calculate contract ages, and support other time-dependent business needs. Learn how to create and compare these values, convert between data types and text, and account for time zones.")
- [Custom Field Attributes](https://help.salesforce.com/s/articleView?id=platform.custom_field_attributes.htm&release=264.0.0&type=5 "A custom field has different attributes depending on its field type.")
- [Define Default Field Values](https://help.salesforce.com/s/articleView?id=platform.fields_defining_default_values.htm&release=264.0.0&type=5 "Define a default value for a field. Use a formula to generate dynamic values or constants for static values.")