iam
6/17/2018 - 9:51 AM

PHP date

date_default_timezone_set( 'Europe/Moscow' );

---

$date = new DateTime( '', new DateTimeZone( 'Europe/Moscow' ) );
$date->format( 'Y-m-d H:i:s' );	

---

date_default_timezone_set('Etc/GMT-5');
$date=date("Y-m-d H:i:s");


$current_week_from = date( 'Y-m-d', strtotime( 'monday this week' ) );
$current_week_to = date( 'Y-m-d', strtotime( 'sunday this week' ) );
$current_month_from = date( 'Y-m-d', strtotime( 'first day of this month' ) );
$current_month_to = date( 'Y-m-d', strtotime( 'last day of this month' ) );
$friday = date( 'Y-m-d', strtotime( 'friday this week' ) );
$previous_week_from = date( 'Y-m-d', strtotime( 'monday previous week' ) );
$previous_week_to = date( 'Y-m-d', strtotime( 'sunday previous week' ) );
$previous_month_from = date( 'Y-m-d', strtotime( 'first day of previous month' ) );
$previous_month_to = date( 'Y-m-d', strtotime( 'last day of previous month' ) );