• 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

PHP Fatal error: Class not found - PHPUnit

How to give apache permission to write to home directory?

Magento 2 - Controller returning blank page

How to test laravel controller method?

Sum array values of a column within each column of an array with 3 levels

How to to send mail using gmail in Laravel?

Must be of the type array, null given,

Twig - How to check if variable is a number / integer

Check if string contains a value in array [duplicate]

Symfony - EasyAdmin - Add and remove functions are ignored from AssociationField

Search for array row with specific column value and return another value from qualifying row

Invalid value in field "itemtype" in Google Search Console

Sort a multidimensional array by integer inside of a string value which is two levels down

Target class controller does not exist - Laravel 8

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

About Contact Privacy policy Terms and conditions