Test One uses the site-wide setting of UTC.
"Display Mode" settings per-node are setup on individual testing fields.
Regional Display Settings
System Timezone setting are set here /admin/config/regional/settings
These setting can be opened for User Level change.
Times Set on a Content Field's "Display Tab":
Timezone Testing; UTC and EST Testing Fields
Testing One - EST Database Storage
EST Date Field Database Value: 2023-04-04T09:00:00
EST Date Range Database Value: 2023-04-04T09:00:00 - 2023-04-04T10:00:00
EST Timestamp Database Value: 1680598800
Testing One - UTC Database Storage
UTC Date Field Database Value: 2023-04-04T09:00:00
UTC Date Range Database Value: 2023-04-04T09:00:00
2023-04-04T10:00:00
UTC Timestamp Database Value: 1680598800
Test One Results:
Test Two Setup Changes
The System time is set to a Timezone of New_York. The Display Modes setting for the field vvalues are not changed.
consider importing the DateTime class and working with its timezone features.
namespace Drupal\tamper\Plugin\Tamper;use DateTime; use DateTimeZone; use Drupal\Core\Form\FormStateInterface; use Drupal\tamper\Exception\TamperException; use Drupal\tamper\TamperableItemInterface; use Drupal\tamper\TamperBase;use the DateTime class to create new datetime objects with specific timezones, and manipulate them as needed within your tamper.
drupal_get_user_timezone(). It returns the timezone object based on the user's timezone preference in their account settings, or the site's timezone if the user is not logged in or has not set a preference. You can use this function to get the timezone object and then pass it to the DateTime constructor. Here's an example:
