Skip to content

Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.

fix: timezone for cronjobs now comes from TZ env var first (#791)

Miguel Ribeiro66a1a45f2dc1
diff --git a/endpoints/cronjobs/settimezone.php b/endpoints/cronjobs/settimezone.php
index e3ca8fd..86f080c 100644
--- a/endpoints/cronjobs/settimezone.php
+++ b/endpoints/cronjobs/settimezone.php
@@ -1,7 +1,11 @@
<?php
-$timezone = date_default_timezone_get();
+$timezone = getenv('TZ');
if ($timezone == '') {
- $timezone = 'UTC';
+ $timezone = date_default_timezone_get();
+ if ($timezone == '') {
+ $timezone = 'UTC';
+ }
}
+
date_default_timezone_set($timezone);
\ No newline at end of file
diff --git a/includes/version.php b/includes/version.php
index aba0ade..c486545 100644
--- a/includes/version.php
+++ b/includes/version.php
@@ -1,3 +1,3 @@
<?php
-$version = "v2.51.0";
+$version = "v2.51.1";
?>
\ No newline at end of file