datetime widget shows user's timezone but saves in UTC
- Dominant language
- JavaScript
- Stars
- 19.4k
- Forks
- 3.1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
**Describe the bug**
If i see the datetime widget, it correctly shows my local time. When i set the date to now and save, the date&time is saved for UTC, e.g. 2024-10-31T20:57:00.000Z but should save it as 2024-10-31T20:57:00+02:00.
**To Reproduce**
1. create content
2. use the a datetime widget
3. hit the "now" button
4. save
**Expected behavior**
2024-10-31T20:57:00+02:00 is saved
**Applicable Versions:**
- Decap CMS version: 3.3.3
- Git provider: gitlab
- OS: Archlinux
- Browser version Firefox 132
**CMS configuration**
```
backend:
name: gitlab
repo: asdf/gfhrehrther
branch: master
auth_type: pkce
app_id: asdf
site_url: https://sadfgsdfgsdfgsdfg.as
media_folder: "static/images"
public_folder: "/images"
collections:
- name: "blog"
label: "Blog Posts"
label_singular: "Blog Post"
folder: "content/post"
create: true
slug: "{{slug}}"
editor:
preview: false
fields:
- { label: "Title", name: "title", widget: "string" }
- { label: "Draft", name: "draft", widget: "boolean" }
- { label: "Publish Date", name: "date", widget: "datetime" }
- { label: "Category", name: "category", widget: "select", multiple: true, min: 1, options: [] }
- { label: "Tags", name: "tag", widget: "list", min: 1 }
- { label: "Body", name: "body", widget: "markdown" }
view_filters:
- label: Drafts
field: draft
pattern: true
view_groups:
- label: Category
field: category
```
Contributor guide
Assessment
This issue has not been assessed yet.