• 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

SlimExceptionHttpNotFoundException

find in set in laravel ? example

How to convert time from one timezone to another in PHP

Testing subscription renewals on Stripe

How to change product Image when variables are selected in Shop and Archive Pages?

Check if a string contain multiple specific words

Cannot connect to own websocket server when on secured domain

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

How to get AJAX to post on second page?

curl returning 301 error after migrating to https

Submitting a form with ajax in Wordpress

Auto increment id JSON

Display the WooCommerce product price inside a custom function

how to fix Service provider class not found when using repository?

Select option menu read from database and use it's values

About Contact Privacy policy Terms and conditions