When I create a new content with this from the dashboard, the date format is not respected and it gives me something like date: 2025-03-17T05:47:48Z but when I click "Now" in the Front Matter sidebar, it gives me the correct format like date: 2025-03-17T11:18:47+05:30
To Reproduce
Steps to reproduce the behavior:
Configure a date format like the one above.
Create a new content.
The date in the newly generated content front matter will be incorrectly formatted.
Click "Now" in the date field in the Front Matter sidebar, it gives the date in the correct format.
Expected behavior
Instead, I would think Front Matter would respect the configured format when creating new content initially without having to manually set the date through the sidebar.
Device:
Front Matter CMS Version: 10.8.0
**Describe the bug**
I have a field like this:
```json
{
"title": "Publishing date",
"name": "date",
"type": "datetime",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"default": "{{now}}",
"isPublishDate": true
}
```
When I create a new content with this from the dashboard, the date format is not respected and it gives me something like `date: 2025-03-17T05:47:48Z` but when I click "Now" in the Front Matter sidebar, it gives me the correct format like `date: 2025-03-17T11:18:47+05:30`
**To Reproduce**
Steps to reproduce the behavior:
1. Configure a date format like the one above.
2. Create a new content.
3. The date in the newly generated content front matter will be incorrectly formatted.
4. Click "Now" in the date field in the Front Matter sidebar, it gives the date in the correct format.
**Expected behavior**
Instead, I would think Front Matter would respect the configured format when creating new content initially without having to manually set the date through the sidebar.
**Device:**
- Front Matter CMS Version: 10.8.0
<!-- github-sync-id:2925451069 -->
@pottekkat good catch. This has to do with the frontMatter.global.timezone setting that was not considered on the DateTime field. Actually, the page creation was working correctly. As the default setting is set to UTC.
You can change the setting's value to your timezone or set it to an empty string. That way, it takes the timezone of your editor.
@pottekkat good catch. This has to do with the `frontMatter.global.timezone` setting that was not considered on the `DateTime` field. Actually, the page creation was working correctly. As the default setting is set to UTC.
You can change the setting's value to your timezone or set it to an empty string. That way, it takes the timezone of your editor.
<!-- github-comment-id:2753520849 -->
That makes sense. I set this frontMatter.global.timezone to an empty string, and it works as I want functionally. But I would assume this is still an issue and the dateFormat should be considered, right?
That makes sense. I set this `frontMatter.global.timezone` to an empty string, and it works as I want functionally. But I would assume this is still an issue and the `dateFormat` should be considered, right?
<!-- github-comment-id:2753569476 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Describe the bug
I have a field like this:
When I create a new content with this from the dashboard, the date format is not respected and it gives me something like
date: 2025-03-17T05:47:48Zbut when I click "Now" in the Front Matter sidebar, it gives me the correct format likedate: 2025-03-17T11:18:47+05:30To Reproduce
Steps to reproduce the behavior:
Expected behavior
Instead, I would think Front Matter would respect the configured format when creating new content initially without having to manually set the date through the sidebar.
Device:
@pottekkat good catch. This has to do with the
frontMatter.global.timezonesetting that was not considered on theDateTimefield. Actually, the page creation was working correctly. As the default setting is set to UTC.You can change the setting's value to your timezone or set it to an empty string. That way, it takes the timezone of your editor.
That makes sense. I set this
frontMatter.global.timezoneto an empty string, and it works as I want functionally. But I would assume this is still an issue and thedateFormatshould be considered, right?Yes, I also changed the beta version's code to support the timezone in the DateTime field.
Version 10.9.0 just got released with this fix included.