Skip to content

Instantly share code, notes, and snippets.

View mocfaisal's full-sized avatar
🔥
On Fire

Salz mocfaisal

🔥
On Fire
View GitHub Profile
@mocfaisal
mocfaisal / I'm an early 🐤
Last active September 23, 2021 00:39
Productive-Box
🌞 Morning 44 commits ███▌░░░░░░░░░░░░░░░░░ 17.1%
🌆 Daytime 119 commits █████████▋░░░░░░░░░░░ 46.1%
🌃 Evening 79 commits ██████▍░░░░░░░░░░░░░░ 30.6%
🌙 Night 16 commits █▎░░░░░░░░░░░░░░░░░░░ 6.2%
@mocfaisal
mocfaisal / age_calculate.php
Created May 19, 2021 10:33
calculating age based on date of birth, resulting in year, month, day
<?php
// refference : https://www.w3resource.com/php-exercises/php-date-exercise-18.php
$bday = new DateTime('2021-05-18'); // Your date of birth
$today = new Datetime(date('Y-m-d'));
$diff = $today->diff($bday);
printf(' Your age : %d years, %d month, %d days', $diff->y, $diff->m, $diff->d);
printf("<br>");
printf("<br>");