webrider
webrider

Reputation: 95

show error for date(); function

I am using windows 7 (32 bit) and firefox 8.

When I used

"date(d m y);" function, 

it shows yesterday's date rather showing today's date. Besides, when I used

"date(h.i.s);" function, 

it should show 12.40.39 but it showing 6.40.39 and for

"date(H.i.s);" 

showing 18.40.39 rather showing 24.40.39. Is it a configuring problem of my browser or something else?

Upvotes: 0

Views: 64

Answers (2)

anubhava
anubhava

Reputation: 785661

Put this line on top of your code to set your timezone correctly:

<?php
date_default_timezone_set("Asia/Dhaka");
?>

Upvotes: 2

Fenec
Fenec

Reputation: 1222

Just set your timezone http://php.net/manual/en/function.date-default-timezone-set.php

Upvotes: 1

Related Questions