• 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

Appending data to an anchor tag

Laravel Multi-language routes without prefix

MongoDB Duplicate Documents even after adding unique key

Assets not referencing to public folder (Laravel)

I need to link Google Sheet with my Laravel

Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

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

PHPS source file - 403 Forbidden You don't have permission to access this resource

Laravel Blade checkbox not checked

Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in

php code to send checkbox form results to email

How to use PHPCBF to fix one issue at a time?

MySQL - Connection failed: No route to host

OAuth2 Token PHP

"Mixed content blocked" when running an HTTP AJAX operation in an HTTPS page

About Contact Privacy policy Terms and conditions