Answers.Body: <p>Solved. Presumably this was a bug. An update just hit for Craft CMS 3.7.9 which states in the release notes &quot;Fixed a bug where Date fields weren’t handling array values with datetime keys properly. (#9708)&quot;.</p>
  <p>Code now works as expected.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-19T15:48:33.687Z
Answers.LastActivityDate: 2021-08-19T15:48:33.687Z
Answers.UserDisplayName: Mosswalker
Body: <p>Following the example in the documentation, this code:</p>
  <pre><code>&lt;input type=&quot;datetime-local&quot; name=&quot;fields[startDate][datetime]&quot; value=&quot;{{ currentValue }}&quot;&gt;
  
  &lt;select name=&quot;fields[startDate][timezone]&quot;&gt;
      &lt;option value=&quot;UTC&quot; selected&gt;UTC&lt;/option&gt;
      &lt;option value=&quot;America/Los_Angeles&quot;&gt;Pacific Time&lt;/option&gt;
      &lt;!-- ... --&gt;
  &lt;/select&gt;
  </code></pre>
  <p>Does not work for me. Nothing is saved. The form is otherwise working.</p>
  <p><strong>If I simplify to this, it saves: (note that I've removed [datetime] as well as the timezone)</strong></p>
  <pre><code>&lt;input type=&quot;datetime-local&quot; name=&quot;fields[startDate]&quot; value=&quot;{{ currentValue }}&quot;&gt;
  </code></pre>
  <p><strong>This also does not save:</strong></p>
  <pre><code>&lt;input type=&quot;datetime-local&quot; name=&quot;fields[startDate][datetime]&quot; value=&quot;{{ currentValue }}&quot;&gt;
  </code></pre>
  <p><strong>If I include a hidden field for timezone, it saves:</strong></p>
  <pre><code>&lt;input type=&quot;datetime-local&quot; name=&quot;fields[startDate][datetime]&quot; value=&quot;{{currentValue}}&quot;&gt;
  {{ hiddenInput('fields[startDate][timezone]', tz) }}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-18T17:35:57.480Z
Comments.Text: Where is this being posted - to an entry? Looks like you're using [this](https://craftcms.com/docs/3.x/time-fields.html#working-with-time-field-data) example?
Comments.UserDisplayName: RitterKnight
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-19T08:24:08.653Z
Comments.Text: Is the `startDate` field set to **Show date and time** and has the option **Show Time Zone** active? Otherwise, the timezone is ignored. Also, how are you checking if the timezone is saved or not? What is your expected result in your example and what are you seeing instead?
Comments.UserDisplayName: MoritzLost
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-19T14:45:08.423Z
Comments.Text: Thanks for the questions. Yes, the field is set with the "show date and time" and "show time zone options." I'm checking the data, including the timezone, in the control panel. When I am saying it does not save, I mean that the field is empty after saving-- both the date/time and the timezone.
Comments.UserDisplayName: Mosswalker
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-19T15:14:09.690Z
Comments.Text: @RitterKnight No, I'm using [this](https://craftcms.com/docs/3.x/date-time-fields.html#customizing-the-timezone) example from the DATE field. It is being saved to an entry.
Comments.UserDisplayName: Mosswalker
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-19T17:19:19.107Z
Comments.Text: Voting to close this because it was a bug.
Comments.UserDisplayName: RitterKnight
Tags: <timezone>
Title: Letting front-end user set time zone
ThreadText: # Letting front-end user set time zone
  
  (Asked by: username_0 on 2021-08-18)
  
  Following the example in the documentation, this code:
  
  ```
  <input type="datetime-local" name="fields[startDate][datetime]" value="{{ currentValue }}">
  
  <select name="fields[startDate][timezone]">
      <option value="UTC" selected>UTC</option>
      <option value="America/Los_Angeles">Pacific Time</option>
      <!-- ... -->
  </select>
  
  ```
  
  Does not work for me. Nothing is saved. The form is otherwise working.
  
  **If I simplify to this, it saves: (note that I've removed [datetime] as well as the timezone)**
  
  ```
  <input type="datetime-local" name="fields[startDate]" value="{{ currentValue }}">
  
  ```
  
  **This also does not save:**
  
  ```
  <input type="datetime-local" name="fields[startDate][datetime]" value="{{ currentValue }}">
  
  ```
  
  **If I include a hidden field for timezone, it saves:**
  
  ```
  <input type="datetime-local" name="fields[startDate][datetime]" value="{{currentValue}}">
  {{ hiddenInput('fields[startDate][timezone]', tz) }}
  
  ```
  
  **Tags:** timezone
  
  > **Comments:**
  > **username_1**: Where is this being posted - to an entry? Looks like you're using [this](https://craftcms.com/docs/3.x/time-fields.html#working-with-time-field-data) example?  
  > **username_2**: Is the `startDate` field set to **Show date and time** and has the option **Show Time Zone** active? Otherwise, the timezone is ignored. Also, how are you checking if the timezone is saved or not? What is your expected result in your example and what are you seeing instead?  
  > **username_0**: Thanks for the questions. Yes, the field is set with the "show date and time" and "show time zone options." I'm checking the data, including the timezone, in the control panel. When I am saying it does not save, I mean that the field is empty after saving-- both the date/time and the timezone.  
  > **username_0**: @username_1 No, I'm using [this](https://craftcms.com/docs/3.x/date-time-fields.html#customizing-the-timezone) example from the DATE field. It is being saved to an entry.  
  > **username_1**: Voting to close this because it was a bug.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-08-19. Score: 1
  
  Solved. Presumably this was a bug. An update just hit for Craft CMS 3.7.9 which states in the release notes "Fixed a bug where Date fields weren’t handling array values with datetime keys properly. (#9708)".
  
  Code now works as expected.
  
  
  ---
  
  