For different Date formats:


Today is 05/03/24 - which uses the date('m/d/y') function
Today is 05/03/2024 - which uses the date('m/d/Y') function
Today is May/03/24 - which uses the date('M/d/y') function
Today is May/03/24 - which uses the date('F/d/y') function
Today is May/Fri/24 - which uses the date('F/D/y') function
Today is 05-03-24 : which uses the date('m-d-y') function

CEST202403am24 1918 05/03/2024 using date('Today is m/d/Y')
Today is 05/03/2024
Today is 03rd of May in 2024
Now the time is: 10:19:18 == h:i:s - hour:minute:seconds of the server location (Italy)
Now the time is: 10:19:18am == h:i:sa - hour:minute:secondspm/am of the server location (Italy)
Now the time is: 10:19:18AM == h:i:sA - hour:minute:secondsPM/AM of the server location (Italy)
Now the time is: 10:19:18AM == H:i:sA - Military Time of the server location (Italy)


For setting up Timezones:

date_default.timezone_set('America/New_York')
After changing the Timezone to NY, the time is now: 04:19:18AM
After changing the Timezone to LA, the time is now: 01:19:18AM

Now we format different days in the week:

Today is: Friday == lowercase l
Today is: Fri == D
Today is: 5 == w

Create dates or times using String

$d = srtotime('');// String to Time - January 1st, 1970 was the beginning of comp time
This many seconds have passed since 12:00 AM 1/1/1970 to March 21 1997: 858931200
This many seconds have passed since 1714724358
What day is March 21 1997: Friday
What day was my birthday: Friday

For making a time:


$anotherday = mktime(11/*Hour*/, 14/*Minute*/, 52/*Seconds*/, 8/*Month*/, 25/*Day*/, 2008/*Year*/);

The time in seconds since beginning of 1970 to the given time is 1219688092
The created time is: 2008-08-25 11:14:52AM
The created time is: 2008-08-25 12:00:00AM
The created time is: 2008-08-25 11:14:52AM
The created time is: 1969-12-31 04:00:00PM == incorrect format
The created time is: 2008-08-25 12:00:00AM == workable format
The created time is: 1969-12-31 04:00:00PM ==incorrect format

Tomorrow is: 2024-05-04 - attaching 'tomorrow' to strtotime()
Next saturday is: 2024-05-04 - attaching 'next saturday' to strtotime()
Next saturday is: 2024-05-04 - attaching 'saturday' to strtotime()
+3 months: 2024-08-03 - +3 months, time()
+2 weeks: 2024-05-17 - +2 weeks, time()
The created time is: 2020-01-23 12:00:00AM
The created time is: 1969-12-31 04:00:00PM == WRONG FORMAT
The created time is: 2020-01-23 12:00:00AM == FIXED FORMAT

For counting down:


Variables 1671955200 and 1714724358

There are still -42769158 many seconds until Christmas

There are still -495 many days until Christmas



Variables 1720076400 and 1714724358

Second Test - Past: 62 many days past july 4



Variables -806950800 and 1714724358

D-Day: 34 days