You are here: Re: Server Time Minus Two Hours in php « PHP Language « IT news, forums, messages
Re: Server Time Minus Two Hours in php

Posted by Rauch Christian on 05/26/07 10:36

Anonymous Chief wrote:
> How can I modify my sdcript to show server time minus 2 hours? The script
> below only shows server date and time:
>
> I have tried:
> echo date ("l d F, Y - H-2:i.s");
>
> ...but it would only show Friday 25 May, 2007 - 22-2:40.53
>
> Could someone please help me.

date accepts a second param being a unix timestamp (otherwise it takes the current timestamp). As a unix timestamp unit are seconds, you can use the following:

echo date ("l d F, Y - H-2:i.s",time() - 60*60*2);

Regards,
Chris

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация