diff options
Diffstat (limited to 'core/os/time.cpp')
-rw-r--r-- | core/os/time.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/os/time.cpp b/core/os/time.cpp index 7068935d36..d1d3588d09 100644 --- a/core/os/time.cpp +++ b/core/os/time.cpp @@ -255,7 +255,7 @@ String Time::get_time_string_from_unix_time(int64_t p_unix_time_val) const { return vformat("%02d:%02d:%02d", hour, minute, second); } -Dictionary Time::get_datetime_dict_from_datetime_string(String p_datetime, bool p_weekday) const { +Dictionary Time::get_datetime_dict_from_datetime_string(const String &p_datetime, bool p_weekday) const { PARSE_ISO8601_STRING(Dictionary()) Dictionary dict; dict[YEAR_KEY] = year; @@ -273,7 +273,7 @@ Dictionary Time::get_datetime_dict_from_datetime_string(String p_datetime, bool return dict; } -String Time::get_datetime_string_from_datetime_dict(const Dictionary p_datetime, bool p_use_space) const { +String Time::get_datetime_string_from_datetime_dict(const Dictionary &p_datetime, bool p_use_space) const { ERR_FAIL_COND_V_MSG(p_datetime.is_empty(), "", "Invalid datetime Dictionary: Dictionary is empty."); EXTRACT_FROM_DICTIONARY VALIDATE_YMDHMS("") @@ -287,7 +287,7 @@ String Time::get_datetime_string_from_datetime_dict(const Dictionary p_datetime, return timestamp; } -int64_t Time::get_unix_time_from_datetime_dict(const Dictionary p_datetime) const { +int64_t Time::get_unix_time_from_datetime_dict(const Dictionary &p_datetime) const { ERR_FAIL_COND_V_MSG(p_datetime.is_empty(), 0, "Invalid datetime Dictionary: Dictionary is empty"); EXTRACT_FROM_DICTIONARY VALIDATE_YMDHMS(0) @@ -295,7 +295,7 @@ int64_t Time::get_unix_time_from_datetime_dict(const Dictionary p_datetime) cons return day_number * SECONDS_PER_DAY + hour * 3600 + minute * 60 + second; } -int64_t Time::get_unix_time_from_datetime_string(String p_datetime) const { +int64_t Time::get_unix_time_from_datetime_string(const String &p_datetime) const { PARSE_ISO8601_STRING(-1) VALIDATE_YMDHMS(0) YMD_TO_DAY_NUMBER |