• 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

Laravel-fopen: failed to open stream: Permission denied

How to upload mpdf file after generating to s3 bucket in php

Send POST data via raw JSON with Postman

image source not readable

Laravel csrf token mismatch for ajax POST Request

MOODLE: What does it mean to aggregate h5p assets?

Google Calendar API batch request PHP

Laravel get user data with profile

Filter WooCommerce related products by Polylang language

Laravel Model save() & update() Not Saving

How to fix " Uncaught TypeError: Argument 1 passed to JpGraphException::defaultHandler() " problem in php 7.1.3 and jpgraph 4.2.6?

Phalcon: setStatusCode returns empty response

How to get result of the formula on import xlsx with maatwebsite using Laravel? I get formula and not value of the formula

Combine multiple columns into an array as one of the key in a results set

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

About Contact Privacy policy Terms and conditions