Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
helper | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
date_format | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Traits; |
4 | |
5 | use App\Models\Setting; |
6 | use DateTime; |
7 | use DateTimeZone; |
8 | |
9 | trait helper |
10 | { |
11 | public static function date_format($date){ |
12 | $newDate = new DateTime($date, new DateTimeZone(env('TIMEZONE', 'Africa/Cairo')) ); //in defoult timezone |
13 | $newDate->setTimeZone(new DateTimeZone(getTimeZone())); // in setting time_zone |
14 | |
15 | return $newDate->format(getDateFormat()); |
16 | } |
17 | } |