• 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

How do I remove this delivery notification from here?

CodeIgniter 4: Like and Dislike Functionality

How to find phpcs current default standard

Exception thrown during the rendering of a template("Parameter "id" for route "url" must match "[^/]++" ("" given) to generate a corresponding URL.")

Check if my GET request has Header: Token

PHPExcel file download using AJAX call

disable two buttons after clicking another button

How to get transaction details in notify_url page in paypal

No definition found for function in vendor vscode

Display a product custom field only in WooCommerce Admin single orders

enroll_table three field fetch to payment form to create payment field in laravel 5.5

How to average columns of data from multiple, flat arrays?

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

How to install ZeroMQ for PHP on an Alpine Linux container?

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

About Contact Privacy policy Terms and conditions