I’m exploring the best way to manage multilingual content in Drupal and wanted to share an option I recently worked with: Linguise. It’s an AI-powered translation tool that integrates with Drupal to help translate websites automatically while keeping them SEO-friendly.
This is not a question, just a place to put some information which I could not find for the love of god anywhere and ChatGPT sent me down a wrong rabbit hole. Hopefully it saves somebody else some time? :-)
$new_datetime = gmdate('c', strtotime('+10 days'));
$date_time_obj = new DrupalDateTime($new_datetime, new \DateTimeZone('Pacific/Apia'));
$entity->set('your_date_field', ['value' => $date_time_obj->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT), 'timezone' => 'Pacific/Apia']);