mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
Add helper function format_http_date
This commit is contained in:
parent
57bf10dbc5
commit
3ac4a98ecb
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Carbon\Carbon;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Arr;
|
||||
@ -435,3 +436,17 @@ if (! function_exists('get_db_config')) {
|
||||
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