PluginProbe
WANotifier for Forms and Actions / 2.4.5
WANotifier for Forms and Actions v2.4.5
3.1.1 3.1.0 3.0.4 2.7.10 2.7.11 2.7.12 2.7.13 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 3.0.0 3.0.1 3.0.2 3.0.3 trunk 0.1.0 0.1.1 1.0.0 1.0.1 1.0.2 All 67 releases
← All changes | includes/functions/functions-notifier-helpers.php +0 -40 2.7.8 → 2.4.5 View file →
@@ -203,44 +203,4 @@
203 203 $randomString .= $characters[rand(0, $charactersLength - 1)];
204 204 }
205 205 return $randomString;
206 206 }
207 -
208 -/**
209 - * Converts a UTC date string to the WordPress site's timezone.
210 - */
211 -function notifier_convert_date_from_utc($utc_date, $format = 'Y-m-d H:i:s') {
212 - if ($utc_date === '') {
213 - return current_time('mysql');
214 - }
215 -
216 - try {
217 - $timezone_string = wp_timezone_string() ?: 'UTC';
218 - $site_timezone = new DateTimeZone($timezone_string);
219 - $date = new DateTime($utc_date, new DateTimeZone('UTC'));
220 - $date->setTimezone($site_timezone);
221 - return $date->format($format);
222 - } catch (Exception $e) {
223 - error_log('Error converting UTC date to WordPress timezone: ' . $e->getMessage());
224 - return '';
225 - }
226 -}
227 -
228 -/**
229 - * Converts a date string from the WordPress site's timezone to UTC.
230 - */
231 -function notifier_convert_date_to_utc($wp_date, $format = 'Y-m-d H:i:s') {
232 - if ($wp_date === '') {
233 - return current_time('mysql');
234 - }
235 -
236 - try {
237 - $timezone_string = wp_timezone_string() ?: 'UTC';
238 - $site_timezone = new DateTimeZone($timezone_string);
239 - $date = new DateTime($wp_date, $site_timezone);
240 - $date->setTimezone(new DateTimeZone('UTC'));
241 - return $date->format($format);
242 - } catch (Exception $e) {
243 - error_log('Error converting date from WordPress timezone to UTC: ' . $e->getMessage());
244 - return '';
245 - }
246 -}