• 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

Shortcode or PHP inside a shortcode in Wordpress

Symfony run hint kernel.secret parameter not found

Laravel dosen't connect with Oracle

Redis Command To Sort Keys

php curl_exec() Connection refused when retrieving a remote image

generate an Excel file using PHP

PHP each() function replacement

how to make my own auto increment in php?

Transpose csv file data [duplicate]

RuntimeException: Unable to create the cache directory (/var/www/sonata/app/cache/dev)

How to get median and quartiles/percentiles of an array in JavaScript (or PHP)?

PHP drop down list using array's and foreach (else and for) code

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

Laravel Unknown Column 'updated_at'

Issue with laravel eloquent model property

About Contact Privacy policy Terms and conditions