Timezone issue on email template
-
Good evening, team. We spotted a timezone issue with the email notifications that Hydra was sending to hosts and attendees. It wasn’t localizing the attendee times correctly. I’ve prepared the following patch. Please consider applying it:
--- wp-content/plugins/hydra-booking/includes/hooks/MailHooks.php.orig 2026-06-25 18:47:35
+++ wp-content/plugins/hydra-booking/includes/hooks/MailHooks.php 2026-06-25 18:47:40
@@ -834,13 +834,15 @@
}
$time_format = get_option( 'time_format', 'g:i a' );
- $timestamp = strtotime( '1970-01-01 ' . $time_value );
+ // $time_value is already the attendee's local wall-clock time. Parse and
+ // format it in UTC so wp_date() does not shift it into the site timezone.
+ $timestamp = strtotime( '1970-01-01 ' . $time_value . ' UTC' );
if ( false === $timestamp ) {
return $time_value;
}
- return wp_date( $time_format, $timestamp );
+ return wp_date( $time_format, $timestamp, new \DateTimeZone( 'UTC' ) );
}
/**
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.