• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

phpsymfonydatetimedoctrine-orm


PHP Snippet 1:

$entEmail = new Email();
$entEmail->setViewedAt(null);

PHP Snippet 2:

$Date = date('Y-m-d H:i:s');

PHP Snippet 3:

date_default_timezone_set('America/New_York');
$date = date('Y-m-d H:i:s');

$entEmail = new Email();
$entEmail->setViewedAt( $date );

PHP Snippet 4:

date_default_timezone_set('America/New_York');

$entEmail = new Email();
$entEmail->setViewedAt( date('Y-m-d H:i:s') );

Related Snippets

Can I use a WooCommerce function without any WooCommerce page?

CodeIgniter 3 is generating a session file on each request, why?

javascript html popup window

Issue saving card for customer

Split comma separated value from table column into rows using mysql?

How to get Laravel's CSRF Token from Another Website?

Laravel Get Days In Month From Month Number?

Laravel php artisan serve to mimic HTTPS

Redis Command To Sort Keys

Pages are working fine on localhost but not running on the hosting server

Mobile browsers are adding .html to filename on download

php script to delete files older than 24 hrs, deletes all files

Which is faster php date functions or carbon?

How to make Canonicals with PHP

how to redirect the user back to desired URL after login page in PHP?

About Contact Privacy policy Terms and conditions