Update config.php

This commit is contained in:
Namhyeon Go 2020-03-25 11:41:37 +09:00 committed by GitHub
parent b40c1e518a
commit bb1c3a1b59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,7 @@ if(!is_fn("get_current_timestamp")) {
$units = array(
"s" => array( 1, "second", "seconds"),
"m" => array( 60, "minute", "minutes"),
"h" => array( 120, "hour", "hours" ),
"h" => array( 3600, "hour", "hours" ),
"d" => array(86400, "day", "days" )
);
$_L = intval(substr($adjust, 0, -1));
@ -116,6 +116,21 @@ if(!is_fn("get_current_timestamp")) {
}
}
if(!is_fn("get_seconds")) {
function get_seconds($interval) {
$time = 0;
$_U = array("s" => 1, "m" => 60, "h" => 3600, "d" => 86400);
$_L = intval(substr($interval, 0, -1));
$_R = substr($interval, -1);
if(array_key_exists($_R, $_U)) {
$time = $_L * $_U[$_R];
}
return $time;
}
}
if(!is_fn("get_current_datetime")) {
function get_current_datetime($options=array()) {
$config = get_config();