Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 200 characters in body
Source Link
Kristine
  • 1.2k
  • 6
  • 13

I just created a Drupal 7 Views report to show the date and time when the user created a case activity. The date is correct. However, I entered this activity at 11:09 am this morning, but Views show the time as 7:08pm. I produced the same report in SearchKit and the time there is correct. Is the problem related to Views? I double checked that the date timezone is correct in "Default"Default site/user timezone".

Drupal, PHP, and MySQL timezones match. The activity_created_date table also lists the correct info: 2021-12-24 11:09. Not sure why Views is producing the time as 7:08 pm instead of 11:09 am.

My temporary fix right now is use Global:PHP and subtract 8 hours manually. Although this works, I can't expose this date field for filtering results.

<?php
$hoursToSubtract = 8;
$timeToSubtract = ($hoursToSubtract * 60 * 60);
$timeInPast = ($row->created_date - $timeToSubtract);
echo date("m/d/Y g:ia", $timeInPast);
?>

I just created a Drupal 7 Views report to show the date and time when the user created a case activity. The date is correct. However, I entered this activity at 11:09 am this morning, but Views show the time as 7:08pm. I produced the same report in SearchKit and the time there is correct. Is the problem related to Views? I double checked the date timezone is correct in "Default site/user timezone".

My temporary fix right now is use Global:PHP and subtract 8 hours manually. Although this works, I can't expose this date field for filtering results.

<?php
$hoursToSubtract = 8;
$timeToSubtract = ($hoursToSubtract * 60 * 60);
$timeInPast = ($row->created_date - $timeToSubtract);
echo date("m/d/Y g:ia", $timeInPast);
?>

I just created a Drupal 7 Views report to show the date and time when the user created a case activity. The date is correct. However, I entered this activity at 11:09 am this morning, but Views show the time as 7:08pm. I produced the same report in SearchKit and the time there is correct. Is the problem related to Views? I double checked that the date timezone is correct in "Default site/user timezone".

Drupal, PHP, and MySQL timezones match. The activity_created_date table also lists the correct info: 2021-12-24 11:09. Not sure why Views is producing the time as 7:08 pm instead of 11:09 am.

My temporary fix right now is use Global:PHP and subtract 8 hours manually. Although this works, I can't expose this date field for filtering results.

<?php
$hoursToSubtract = 8;
$timeToSubtract = ($hoursToSubtract * 60 * 60);
$timeInPast = ($row->created_date - $timeToSubtract);
echo date("m/d/Y g:ia", $timeInPast);
?>
deleted 1 character in body
Source Link
Kristine
  • 1.2k
  • 6
  • 13

I just created a Drupal 7 Views report to show the date and time when the user created a case activity. The date is correct. However, I entered this activity at 11:09 am this morning, but Views show the time as 7:08pm. I produced the same report in SearchKit and the time there is correct. Is the problem related to Views?

  I setdouble checked the date format as the "Defaulttimezone is correct in "Default site/user timezone". 

My temporary fix right now is use Global:PHP and subtract 8 hours manually. Although this works, I can't expose this date field for filtering results.

<?php
$hoursToSubtract = 8;
$timeToSubtract = ($hoursToSubtract * 60 * 60);
$timeInPast = ($row->created_date - $timeToSubtract);
echo date("m/d/Y Hg:i a"ia", $timeInPast);
?>

I just created a Drupal 7 Views report to show the date and time when the user created a case activity. The date is correct. However, I entered this activity at 11:09 am this morning, but Views show the time as 7:08pm. I produced the same report in SearchKit and the time there is correct. Is the problem related to Views?

  I set the date format as the "Default site/user timezone". My temporary fix right now is use Global:PHP and subtract 8 hours manually.

<?php
$hoursToSubtract = 8;
$timeToSubtract = ($hoursToSubtract * 60 * 60);
$timeInPast = ($row->created_date - $timeToSubtract);
echo date("m/d/Y H:i a", $timeInPast);
?>

I just created a Drupal 7 Views report to show the date and time when the user created a case activity. The date is correct. However, I entered this activity at 11:09 am this morning, but Views show the time as 7:08pm. I produced the same report in SearchKit and the time there is correct. Is the problem related to Views? I double checked the date timezone is correct in "Default site/user timezone". 

My temporary fix right now is use Global:PHP and subtract 8 hours manually. Although this works, I can't expose this date field for filtering results.

<?php
$hoursToSubtract = 8;
$timeToSubtract = ($hoursToSubtract * 60 * 60);
$timeInPast = ($row->created_date - $timeToSubtract);
echo date("m/d/Y g:ia", $timeInPast);
?>
added 256 characters in body
Source Link
Kristine
  • 1.2k
  • 6
  • 13

I just created a Drupal 7 Views report to show the date and time when the user created a case activity. The date is correct. However, I entered this activity at 11:09 am this morning, but Views show the time as 7:08pm. I produced the same report in SearchKit and the time there is correct. Is the problem related to Views?

I set the custom date format as "g:i a" and Timezonethe "Default site/user timezone". My temporary fix right now is use Global:PHP and subtract 8 hours manually.

<?php
$hoursToSubtract = 8;
$timeToSubtract = ($hoursToSubtract * 60 * 60);
$timeInPast = ($row->created_date - $timeToSubtract);
echo date("m/d/Y H:i a", $timeInPast);
?>

I just created a Drupal 7 Views report to show the date and time when the user created a case activity. The date is correct. However, I entered this activity at 11:09 am this morning, but Views show the time as 7:08pm. I produced the same report in SearchKit and the time there is correct. Is the problem related to Views?

I set the custom date format as "g:i a" and Timezone "Default site/user timezone".

I just created a Drupal 7 Views report to show the date and time when the user created a case activity. The date is correct. However, I entered this activity at 11:09 am this morning, but Views show the time as 7:08pm. I produced the same report in SearchKit and the time there is correct. Is the problem related to Views?

I set the date format as the "Default site/user timezone". My temporary fix right now is use Global:PHP and subtract 8 hours manually.

<?php
$hoursToSubtract = 8;
$timeToSubtract = ($hoursToSubtract * 60 * 60);
$timeInPast = ($row->created_date - $timeToSubtract);
echo date("m/d/Y H:i a", $timeInPast);
?>
Source Link
Kristine
  • 1.2k
  • 6
  • 13
Loading