Question

In: Computer Science

Use what you learned in Chapter 19 to display the following date and time using php:...

Use what you learned in Chapter 19 to display the following date and time using php:

Today is Tuesday October 6th.

The current time is 14:07:29 PM PDT.

Your display should appear exactly has displayed on separate lines. The date should be displayed using one function from the chapter and the time another.

Solutions

Expert Solution

Following is the code of Formatted Date in PHP::

<?php
// Date formatting in PHP
date_default_timezone_set('America/Los_Angeles');//changing default timezone to PDT 
echo "Today is " .date("l F jS.");
echo "\n"; //New-Line Charector
echo "The current time is ".date("H:i:s A T.");

?>

: : The screenshot of output : :

NOTE:

format charecter Description
l A full textual representation of the day of the week such as Sunday ,Monday
F A full textual representation of a month, such as January or March
j Day of the month without leading zeros
S Suffix of day of month ,2 charecters ,example- st,nd,rd or th
H Hour in 24-hour format ,with leading zeroes
i Minutes with leading zeroes
s Seconds with leading zeros
A AM or PM (in uppercase)
T Timezone abbreviation , Example:EST,MDT,PDT...

Above is the complete description of Format charecters used in the code in date() function.

*Please rate this answer. Your feedback is important to us.


Related Solutions

Using Linux in VirtualBox To display your system date: Type date in the command line, and...
Using Linux in VirtualBox To display your system date: Type date in the command line, and press Enter. What do you see?                                            You might see the abbreviation EDT (Eastern Daylight Time) instead of EST (Eastern Standard Time), or another time zone abbreviation, such as MDT (Mountain Daylight Time) or CST (Central Standard Time). Notice also that UNIX/Linux uses a 24-hour clock. Type Date in the command line, and press Enter. What error do you see?                                    The system error...
Use what you have learned about the time value of money to analyze each of the...
Use what you have learned about the time value of money to analyze each of the following decisions: Decision #1:   Which set of Cash Flows is worth more now? Assume that your grandmother wants to give you generous gift. She wants you to choose which one of the following sets of cash flows you would like to receive: Option A: Receive a one-time gift of $10,000 today.    Option B: Receive a $1600 gift each year for the next 10...
Use what you have learned about the time value of money to analyze each of the...
Use what you have learned about the time value of money to analyze each of the following decisions: Decision #1:   Which set of Cash Flows is worth more now? Assume that your grandmother wants to give you generous gift. She wants you to choose which one of the following sets of cash flows you would like to receive: Option A: Receive a one-time gift of $10,000 today.    Option B: Receive a $1600 gift each year for the next 10...
Use what you have learned about the time value of money to analyze each of the...
Use what you have learned about the time value of money to analyze each of the following decisions: Decision #2: Planning for Retirement Erich and Mallory are 22, newly married, and ready to embark on the journey of life.   They both plan to retire 45 years from today. Because their budget seems tight right now, they had been thinking that they would wait at least 10 years and then start investing $1800 per year to prepare for retirement.   Mallory just...
Use what you have learned about the time value of money to analyze each of the...
Use what you have learned about the time value of money to analyze each of the following decisions: Decision #1:   Which set of Cash Flows is worth more now? Assume that your grandmother wants to give you generous gift. She wants you to choose which one of the following sets of cash flows you would like to receive: Option A: Receive a one-time gift of $ 10,000 today.    Option B: Receive a $1400 gift each year for the next 10...
Use what you have learned about the time value of money to analyze each of the...
Use what you have learned about the time value of money to analyze each of the following decisions: Assume that your grandmother wants to give you generous gift. She wants you to choose which one of the following sets of cash flows you would like to receive: Option A: Receive a one-time gift of $10,000 today.    Option B: Receive a $1600 gift each year for the next 10 years. The first $1600 would be received 1 year from today.   ...
Use what you have learned about the time value of money to analyze each of the...
Use what you have learned about the time value of money to analyze each of the following decisions: Decision #1:   Which set of Cash Flows is worth more now? Assume that your grandmother wants to give you generous gift. She wants you to choose which one of the following sets of cash flows you would like to receive: Option A: Receive a one-time gift of $ 10,000 today.    Option B: Receive a $1400 gift each year for the next...
After reading the materials found below and what you learned in the Chapter answer the following...
After reading the materials found below and what you learned in the Chapter answer the following discussion question: 1. A. What monetary policy and functions of The Fed have been implemented during the Covid-19 pandemic? B. What is the Fed’s Dual Mandate and how do the policies you found for question 1 related to achieving these?
Using PHP, create a form that uses the method GET. The form should capture a date...
Using PHP, create a form that uses the method GET. The form should capture a date using two numbers        Month (1 - 12) and Day (1 - 31) Make sure the form is filled with the user's input after the form is submitted and processed, and the page is redisplayed. If data is being passed into the page, then the page should display the date entered by the user and the season of the year. For example, if the...
PHP You will be using the object oriented features of PHP to design a music album...
PHP You will be using the object oriented features of PHP to design a music album processing page. First you will build a form page called addAlbum.php. This form will contain text fields for album title, artist, publisher (Sony, BMI, etc.) and genre. Add two more fields of your choice. You will post this form to the file process.php. If all the fields have values, we will create a new Album object and print the details of the object. You...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT