2

I am trying to get todays day using PHP date function but it is coming back with 31/03/2013 which is tomorrow. I have tried changing the default timezone but it still returns the same.

    date_default_timezone_set('Europe/Dublin');
    echo date("d/m/Y");

Any ideas?

4
  • 2
    Are you sure the server-time is correct? Also today may be a bad day to test dates since many countries switch DST Commented Mar 30, 2013 at 19:56
  • It's on my windows PC running WAMP. The date on the systray clock is correct unless there is somewhere else I should be checking? Commented Mar 30, 2013 at 19:58
  • 1
    Can you do echo time() both before and after date_default_timezone_set? Commented Mar 30, 2013 at 20:02
  • Yep. The timezone seems to be correct as the time stamp doesn't change when I add/remove the date_default_timezone_set() Commented Mar 30, 2013 at 20:10

1 Answer 1

-2

Looks to like bug in php 5.3.2-1. Try to run the php script in the bug report and post your results.

Sign up to request clarification or add additional context in comments.

3 Comments

-1 vote for : look at here de3.php.net/manual/en/function.date.php , at the end of the example 4 , there is a statement , To format dates in other languages, you should use the setlocale() and strftime() functions instead of date().
@CooPer that link to the fix is dead

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.