Add transfer and account_state today view to reception
This commit is contained in:
@@ -12,6 +12,34 @@ use yii\i18n\Formatter;
|
||||
|
||||
class DateUtil
|
||||
{
|
||||
/**
|
||||
* Get UTC today @00:00:00 .
|
||||
* Helper method to generate date for mysql
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public static function todayStart( ){
|
||||
$d2 = new \DateTime();
|
||||
$d2->setTimezone( new \DateTimeZone( "UTC" ) );
|
||||
$d2->setTime(0, 0, 0);
|
||||
return $d2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get UTC t @00:00:00 .
|
||||
* Helper method to generate date for mysql
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public static function tomorrowStart( ){
|
||||
$d2 = new \DateTime();
|
||||
$d2->add(new \DateInterval('P1D'));
|
||||
$d2->setTimezone( new \DateTimeZone( "UTC" ) );
|
||||
$d2->setTime(0, 0, 0);
|
||||
return $d2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static function addMonth($timestamp, $monthCount = 1)
|
||||
{
|
||||
@@ -65,4 +93,12 @@ class DateUtil
|
||||
return $formatter->asDatetime($dateTimeObject);
|
||||
}
|
||||
|
||||
public static function formatDateUtc($dateTimeObject)
|
||||
{
|
||||
$formatter = new Formatter;
|
||||
$formatter->datetimeFormat = 'php:Y-m-d';
|
||||
$formatter->timeZone = 'UTC';
|
||||
return $formatter->asDatetime($dateTimeObject);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user