I want to use PHP date to write something like:
Generated Fri, Aug 30, 2013 at 1:00pm
using:
echo "Generated ".date('D, M j, Y at g:ia');
However, I cannot use the "at" because that is swapped with 00am
Is there a way to include the word at in the date formation without using two date()?
date_default_timezone_set('UTC'); echo "<strong>Display current date dd/mm/yyyy format </strong>". "<br />"; echo date("d/m/Y"). "<br />"; echo "<strong>Display current date mm/dd/yyyy format</strong> "."<br />"; echo date("m/d/Y")."<br />"; echo "<strong>Display current date mm-dd-yyyy format </strong>".
Z - Timezone offset in seconds. The offset for timezones west of UTC is negative (-43200 to 50400) c - The ISO-8601 date (e.g. 2013-05-05T16:34:42+00:00) r - The RFC 2822 formatted date (e.g. Fri, 12 Apr 2013 12:01:05 +0200)
The date_format() function returns a date formatted according to the specified format.
The task can be done by using the strtotime() function in PHP. It is used to convert English textual date-time description to a UNIX timestamp.
You can escape characters in the output like this:
echo "Generated ".date('D, M j, Y \a\t g:ia');
The following is taken from the PHP Date function (http://php.net/manual/en/function.date.php):
<?php
// prints something like: Wednesday the 15th
echo date('l \t\h\e jS');
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With