Configure Date and Time Fields
Composer defines a field in your data as a date and time field in the following cases:
- The field type is timestamp.
- The field type is numeric containing the number of seconds since the UNIX epoch (UNIX Epoch time). This field type also known as the UNIX time stamp in seconds.
- The field type is numeric containing the number of milliseconds since the UNIX epoch (UNIX Epoch time). This field type is also known as the UNIX time stamp in milliseconds.
- The field is numeric and contains a year value.
- For flat file, Amazon S3, Hadoop Distributed File System (HDFS), and Upload API connectors, the field is a string that matches one of the patterns in Supported Date and Time Formats.
If your data contains a time field, Composer attempts to use the default time format (pattern) established in the data source configuration for the field. If Composer fails to detect a numeric field containing seconds, milliseconds, or years as a time field, change the field in the data source configuration as follows (see Change the Default Date and Time Format):
|If the field contains||Change the field in the data source configuration as follows:|
|seconds||Set the field type to Time and specify a custom time pattern of |
|milliseconds||Set the field type to Time. (The default time pattern will be used).|
|years||Set the field type to Time and specify a custom time pattern of |
If your data contains time-related fields (attributes) that are not stored in a recognized time format, you can convert the fields to time fields using one of the following methods.
- Change the field format in field specifications of the data source configuration. This is not the recommended method for reasons described in Convert Attributes to Time Fields in Data Source Field Specifications.
- Create a Composer derived field to convert the data in the field to a time format supported by Composer. This is the preferred method. See Convert Attributes to Time Fields Using Derived Fields.
You can also manage the time range used when displaying visuals and dashboards. See Use the Time Bar.
Composer works with time data in UTC. Composer recommends that you set the timezone for your data source configurations in UTC to avoid time conversion issues.