title: How do I create a Y (year only) datetime field in Drupal 8?
body: <p><strong><em>Datetime module, Drupal 8:</em></strong> <strong>I want to create a datetime field with year granularity.</strong> In <em>Drupal 7</em>, it was no problem. Now in <em>Drupal 8</em>, it isn't possible anymore. How can I create such a field without the <strong><em>Years Only</em></strong> module since it isn't safe? Can I write a theme function? If so, how do I do that?</p>
  
  <p>Excerpt from the datetime.module:</p>
  
  <p>/** * Defines the format that date and time should be stored in. */</p>
  
  <p><strong>const DATETIME_DATETIME_STORAGE_FORMAT = 'Y-m-d\TH:i:s';</strong></p>
  
  <p>/** * Defines the format that dates should be stored in. */</p>
  
  <p><strong>const DATETIME_DATE_STORAGE_FORMAT = 'Y-m-d';</strong></p>