• 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

Transfer data between JavaScript and PHP through JSON

woocommerce_wp_select options array from product attribute terms

Laravel PackageManifest.php: Undefined index: name

how to youtube api data to print in toolset metabox using a button click before save-post

Connecting an HTML webpage to a SQL Server

how to display a view on laravel 8 and not have a 404 NOT FOUND page?

laravel controller function parameters

get folder directory from input type file - PHP

json_encode turns array into an object

Artisan, creating tables in database

How to increase the PHP upload limits [duplicate]

Symfony redirect if already loggedin from login page

Laravel - Browser displays message again when I press back button

301 Redirect to remove query string on homepage only

Comma separated list from array with "and" before last element

About Contact Privacy policy Terms and conditions