PHP Strftime?

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.


10 points

I am trying to show current date using PHP function strftime():

$date = strftime("%A, %d %B, %Y");

And then printing it like this in the code:

<?php
echo $date;
?>

Somehow this is giving an error in the code. Can someone help?



-6 points

It looks perfectly ok. Seems your error has nothing to do with this, but something else. What error you are getting?

Anonymous's picture
Created by Anonymous
10 points

You can use this function:

$date = date(”l, jS F, Y”);

Example:

Monday, 10th March, 2010

Anonymous's picture
Created by Anonymous

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.