Timestamp Field Reference

This article explains what the Timestamp field is and how to configure it in the Custom Type builder.


The Timestamp field allows content writers to add a specific date and time.

Screenshot of the Timestamp field in the drag-and-drop editor.

Timestamp vs. Date

This field is different from the Date field, which does not include a time of day.

The visual builder

When configuring a Timestamp field, you'll see the options to set the Field name, API ID, and Field placeholder.

Slice Machine vs. Legacy Editor

Editing fields is almost identical in Slice Machine and the Legacy editor. But it is important to know that the mock config option (to add data to preview content fields in the Slice Simulator) is only available in Slice Machine.

Screenshot of the Timestamp field editor.

JSON model

The following table displays the JSON keys and values of the field’s 'API response.

Edit the JSON model with caution

Only edit the JSON model to make changes to the Rich Text field labels. Making abrupt changes can cause conflicts when synchronizing changes with your documents.

type

string (required)

Value must be Timestamp

config

object

Object for the configuration options

config.placeholder

string

A user-friendly placeholder for the field in the entry editor

config.label

string

The label that shows up for the field in the document editor

config.default

string

If set to now, it will automatically fill with today's date and the current time. The default value will only apply to newly created documents. When you set or change the default value, it will not change existing documents.

Example JSON configuration

The following JSON defines a Timestamp field with a default value of today’s date and the current time:

Copy
"example_timestamp" : {
  "type" : "Timestamp",
  "config" : {
    "label" : "Created On",
    "default" : "now"
  }
}

API response example

Here is an API response example of a Timestamp field with the API ID of example_timestamp:

Copy
// API response example of a Timestamp field

{
 //...
 "example_timestamp":"2020-06-27T05:00:00+0000"
}

Was this article helpful?
Not really
Yes, Thanks

Can't find what you're looking for? Spot an error in the documentation? Get in touch with us on our Community Forum or using the feedback form above.