Skip to content

Commit

Permalink
Remove useless date warning to match PHP's RFC
Browse files Browse the repository at this point in the history
Summary: Fixes  #6042. Matches: php/php-src#1029
RFC link: https://wiki.php.net/rfc/date.timezone_warning_removal
Closes #6275

Reviewed By: sgolemon, JoelMarcey

Differential Revision: D2464498

Pulled By: JoelMarcey

fb-gh-sync-id: ff21db1d0c713b23fc422af616c5b5efe88f42de
  • Loading branch information
klaussilveira authored and hhvm-bot committed Nov 27, 2015
1 parent 674bdb7 commit 90509bc
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions hphp/runtime/base/timezone.cpp
Expand Up @@ -37,7 +37,6 @@ IMPLEMENT_RESOURCE_ALLOCATION(TimeZone)
class GuessedTimeZone {
public:
std::string m_tzid;
std::string m_warning;

GuessedTimeZone() {
time_t the_time = time(0);
Expand All @@ -55,23 +54,6 @@ class GuessedTimeZone {
tzid = "UTC";
}
m_tzid = tzid;

#define DATE_TZ_ERRMSG \
"It is not safe to rely on the system's timezone settings. Please use " \
"the date.timezone setting, the TZ environment variable or the " \
"date_default_timezone_set() function. In case you used any of those " \
"methods and you are still getting this warning, you most likely " \
"misspelled the timezone identifier. "

string_printf(m_warning, DATE_TZ_ERRMSG
"We selected '%s' for '%s/%.1f/%s' instead", tzid,
#ifdef _MSC_VER
"Unknown", 0,
#else
ta ? ta->tm_zone : "Unknown",
ta ? (float) (ta->tm_gmtoff / 3600) : 0,
#endif
ta ? (ta->tm_isdst ? "DST" : "no DST") : "Unknown");
}
};
static GuessedTimeZone s_guessed_timezone;
Expand Down Expand Up @@ -168,8 +150,6 @@ String TimeZone::CurrentName() {
return String(env, CopyString);
}

/* Try to guess timezone from system information */
raise_strict_warning(s_guessed_timezone.m_warning);
return String(s_guessed_timezone.m_tzid);
}

Expand Down

0 comments on commit 90509bc

Please sign in to comment.