@@ -353,7 +353,7 @@ function api_get_timezones()
353
353
*
354
354
* @return string The timezone chosen
355
355
*/
356
- function _api_get_timezone ()
356
+ function api_get_timezone ()
357
357
{
358
358
// First, get the default timezone of the server
359
359
$ to_timezone = date_default_timezone_get ();
@@ -394,7 +394,7 @@ function _api_get_timezone()
394
394
*/
395
395
function api_get_utc_datetime ($ time = null , $ return_null_if_invalid_date = false , $ returnObj = false )
396
396
{
397
- $ from_timezone = _api_get_timezone ();
397
+ $ from_timezone = api_get_timezone ();
398
398
$ to_timezone = 'UTC ' ;
399
399
if (is_null ($ time ) || empty ($ time ) || $ time === '0000-00-00 00:00:00 ' ) {
400
400
if ($ return_null_if_invalid_date ) {
@@ -451,7 +451,7 @@ function api_get_local_time(
451
451
}
452
452
// Determining the timezone to be converted to
453
453
if (is_null ($ to_timezone )) {
454
- $ to_timezone = _api_get_timezone ();
454
+ $ to_timezone = api_get_timezone ();
455
455
}
456
456
457
457
// If time is a timestamp, convert it to a string
@@ -525,7 +525,7 @@ function api_strtotime($time, $timezone = null)
525
525
function api_format_date ($ time , $ format = null , $ language = null )
526
526
{
527
527
$ system_timezone = date_default_timezone_get ();
528
- date_default_timezone_set (_api_get_timezone ());
528
+ date_default_timezone_set (api_get_timezone ());
529
529
530
530
if (is_string ($ time )) {
531
531
$ time = strtotime ($ time );
@@ -677,7 +677,7 @@ function date_to_str_ago($date, $timeZone = 'UTC')
677
677
return '' ;
678
678
}
679
679
680
- $ getOldTimezone = _api_get_timezone ();
680
+ $ getOldTimezone = api_get_timezone ();
681
681
$ timeAgo = new TimeAgo ($ timeZone , api_get_language_isocode ());
682
682
$ value = $ timeAgo ->inWords ($ date );
683
683
0 commit comments