The Date field provides you with a calendar selector that enables content editors to easily pick dates and times, which will be returned by the API in ISO 8601 formatted strings.Documentation Index
Fetch the complete documentation index at: https://buttercms.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
You can update your timezone in settings, but this doesn’t add timezone support to datetime fields. Instead, it changes the
updated and published fields on your Content Type objects from the default of UTC to whatever timezone you choose.Field at a glance
Input and output
Input type
Calendar picker with optional time input
API output
string (ISO 8601, no timezone)API response example
Date only
Date with time
Field configuration options
Option Name | Type | Function |
|---|---|---|
| Required? | boolean | Make field required to save page |
| Help text | string | Add help text to describe usage to your team |
| Default value | string | Set a default value for the field |
Common use cases
Publishing and scheduling
- Article publish dates
- Content expiration dates
- Scheduled release dates
- Review dates
Events
- Event start/end times
- Registration deadlines
- Session schedules
- Webinar times
Products and services
- Sale start/end dates
- Product launch dates
- Warranty expiration
- Subscription renewal dates
Content organization
- Historical dates (founding dates, milestones)
- Document effective dates
- Last updated timestamps
Best practices
- Use clear help text: Specify if editors should think in UTC or local time
- Handle timezone display: Convert to the user’s local timezone for display
- Validate future/past dates: Use your application logic to enforce date ranges
- Consider date libraries: Use libraries like date-fns or moment.js for complex formatting
- Store event timezones separately: For events with specific timezones, add a dropdown field for timezone selection
Working with dates in your application
- JavasScript
- Python
- Ruby
- PHP
Date display patterns
| Use case | Format example | Code (JavaScript) |
|---|---|---|
| Blog post | ”March 15, 2024” | toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }) |
| Event | ”Fri, Mar 15 at 2:30 PM” | toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' }) + time |
| Calendar | ”03/15/2024” | toLocaleDateString('en-US') |
| Relative | ”in 3 days” | Use date-fns formatDistanceToNow() |
| ISO | ”2024-03-15” | toISOString().split('T')[0] |