Solved

PHP date and time code

Posted on 2006-07-03
4
424 Views
Last Modified: 2008-02-01
What's the PHP code to include time and/or date etc into a php page so that it would look somethink similar to:

Sunday, 1st December 2005 18:45 GMT?

Thanks
0
Comment
Question by:mpaert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 500 total points
ID: 17032382
Try:

echo date('l, jS F Y H:i e');

-r-
0
 
LVL 14

Expert Comment

by:ThG
ID: 17033230
or you can use strftime() for localized version, using setlocale("your_locale_here");

http://it.php.net/strftime
0
 
LVL 11

Expert Comment

by:neester
ID: 17034047
echo date('r')
0
 
LVL 11

Expert Comment

by:neester
ID: 17034053
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

761 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question