Answers.Body: <p>Here's an example value that will set it to today:</p>
  <pre><code>[
    'timezone' =&gt; 'America/New_York',
    'date' =&gt; date('m/d/Y')
  ]
  </code></pre>
  <p>As always, easiest to find out how it's done by inspecting the fields as they are saved in the control panel.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-11T09:04:05.637Z
Answers.LastActivityDate: 2021-01-11T09:04:05.637Z
Answers.UserDisplayName: Udo
Body: <p>I'd like to set the value of a Date field from my custom PHP code.
  How can this be made? Which format does the Date field expect when using the setValue() function?</p>
  
Tags: <datetime><custom-field>
Title: How to set the value of a Date field from PHP?
ThreadText: # How to set the value of a Date field from PHP?
  
  (Asked by: username_0 on 2021-01-10)
  
  I'd like to set the value of a Date field from my custom PHP code.
  How can this be made? Which format does the Date field expect when using the setValue() function?
  
  **Tags:** datetime, custom-field
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-01-11. Score: 2 | Accepted answer
  
  Here's an example value that will set it to today:
  
  ```
  [
    'timezone' => 'America/New_York',
    'date' => date('m/d/Y')
  ]
  
  ```
  
  As always, easiest to find out how it's done by inspecting the fields as they are saved in the control panel.
  
  
  ---
  
  