Jump to content

getting one day back mysql date


vinpkl

Recommended Posts

hi all

 

my website is running in new zealand and hosting is also in newzealand.

 

To insert the date i m using

<?php
$product_date=date("Y/m/d");
?>

 

So as result the date that gets inserted in database is of one day earlier.

 

like at present its 11feb in newzealand and the date that gets inserted in the database is 10feb.

 

how can i get the current date of newzealand in my database.

 

vineet

Link to comment
https://forums.phpfreaks.com/topic/144621-getting-one-day-back-mysql-date/
Share on other sites

Use gmdate() instead...

 


<?php

$product_date = gmdate ( 'Y/m/d' );

?>

 

hi printf

 

i used the gmdate() but still getting the one day old date.

 

i would like to ask that my website is running in new zealand  but at present i m in india and if i insert any product from india then the date inserted in database will be according to india or newzealand.

 

actually the website is to run only in newzealand so i need to have the date as of present date of newzealand.

 

vineet

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.