Add helper function format_http_date
This commit is contained in:
parent
57bf10dbc5
commit
3ac4a98ecb
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
|
|
@ -435,3 +436,17 @@ if (! function_exists('get_db_config')) {
|
||||||
return config("database.connections.$type");
|
return config("database.connections.$type");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! function_exists('format_http_date')) {
|
||||||
|
/**
|
||||||
|
* Format a UNIX timestamp to string for HTTP headers.
|
||||||
|
*
|
||||||
|
* e.g. Wed, 21 Oct 2015 07:28:00 GMT
|
||||||
|
*
|
||||||
|
* @param int $timestamp
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function format_http_date($timestamp) {
|
||||||
|
return Carbon::createFromTimestampUTC($timestamp)->format('D, d M Y H:i:s \G\M\T');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user