Skip to content

Instantly share code, notes, and snippets.

@davidcostadev
Created March 26, 2017 22:38
Show Gist options
  • Save davidcostadev/8e3fcbe5677389719441b6250076c276 to your computer and use it in GitHub Desktop.
Save davidcostadev/8e3fcbe5677389719441b6250076c276 to your computer and use it in GitHub Desktop.
Happy Birth Code Gilvan Costa
<?php
class People {
public $name;
public $birth;
}
$dad = new People();
$dad->name = 'Gilvan Costa';
$dad->birth = new Datetime('26-03-1971', new DateTimeZone('America/Recife'));
$now = new Datetime('now', new DateTimeZone('America/Recife'));
if($dad->birth->format('d/m') == $now->format('d/m')) {
echo 'Happy Bird '.$dad->name;
} else {
echo 'Today are not '.$dad->name.' happy birth';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment