projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f14c86
)
TimeZone.php
author
leon
<leon@roojs.com>
Fri, 27 Oct 2023 06:51:28 +0000
(14:51 +0800)
committer
leon
<leon@roojs.com>
Fri, 27 Oct 2023 06:51:28 +0000
(14:51 +0800)
TimeZone.php
patch
|
blob
|
history
diff --git
a/TimeZone.php
b/TimeZone.php
index
0f109d7
..
2330614
100644
(file)
--- a/
TimeZone.php
+++ b/
TimeZone.php
@@
-109,6
+109,17
@@
class Pman_Core_TimeZone extends Pman
return self::$timezones;
}
+ function isValidTimeZone($tz) {
+ try {
+ new DateTimeZone($tz);
+ }
+ catch (Exception $e) {
+ return false;
+ }
+
+ return true;
+ }
+
static function toRegion($tz)
{
return explode('/', $tz)[0];