• 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

Printing more than one array using print_r or any other function in php

Create a new line whenever an array value reaches more than 10 characters

Symfony Mercure "Failed to send an update"

Error when uploading certain .png files "Interlace handling should be turned on when using png_read_image"

What will the best solution for this multiple optional filter?

Laravel set default language not working

PHP file_get_contents function

Display specific shipping method if woocommerce product has specific acf field value

Laravel 5.2: Unable to locate factory with name [default]

Can I use a WooCommerce function without any WooCommerce page?

How can i update or reset my password without entering email field in laravel-8?

"properties should not be accessed directly" issue during WooCommerce 3.0 checkout

shell errors running php exec

Laravel Database Strict Mode

str_word_count() function doesn't display Arabic language properly

About Contact Privacy policy Terms and conditions