PHP Year: In order to write any code in PHP, it is important to follow syntax.
Below is a date format. <? echo date("F j, Y"); ?> F j= Month and Date while Y means =Year
Today's date is given with the sample code with only Y representing year. echo date("Y"); ?>
PHP Date:
Today's date is given with the sample code representing month, date and year.
Today's date is shown. echo date("F j, Y"); ?>
The syntax for date is similar but follows an order.
For Instance writing the code without any of the variable will cause changes.
PHP Time:
Interestingly, a similar syntax is given for Server Time <? echo date('h:i:s'); ?>.
Server time is shown. echo date('h:i:s'); ?>
To change the time to a military standard time, one will change the lower case h to uppercase H.<? echo date('H:i:s'); ?>
This gives the time to be echo date('H:i:s'); ?>
PHP Website year ( From xxxx - xxxx):
© Emmanuel Amenuvor 1999 - echo date('Y'); ?> <? echo date('Y'); ?>
prints year.
For Instance writing the code without any of the variable will cause changes.
I hope you found this interesting enough. If you have any suggestions, please post it to the Tech Forum or send us your Feedback
|