• 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

Backend cannot be reached after Typo3 login screen

Applying programmatically a coupon to an Order in WooCommerce3

Pagekite error: FAIL: localhost:8080 is down

HTML + PHP + PHPMAILER

Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in

Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables 11 [closed]

Using Associative arrays

(PHPUnit) PHP Fatal error: Uncaught Error: Call to undefined function each()

Unable to guess the mime type as no guessers are available Laravel 5.2

Encrypt in php and decrypt in Dart(flutter)

Using PHP to connect to a remote MSSQL database

Extract house numbers from address string

Laravel multi auth - Authentication user provider [] is not defined

Return multiple values from a function using mysqli_fetch_assoc [closed]

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

About Contact Privacy policy Terms and conditions