4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Setting Offsets with Date()
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun Jun 02, 2002 12:05 pm (15 years, 4 months ago) Reply with QuoteBack to Top

Right, I want to show the current date on my website, along with the time, but the thing is my server is set to be 9 hours ahead of me, take a look at http://www.bluesweb.co.uk/ , if I used the function :

Code:

<?

echo date ("l dS of F Y h:i:s A");

?>


It would give me a time 9 hours ahead of what I wanted, I just wondered how I could set an offset, so it would give me the correct time rather than the one set by default on the server.

What parameters would I need to use in my PHP code?

Thanks
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
jayant
Team Member



Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India

PostPosted: Sun Jun 02, 2002 5:00 pm (15 years, 4 months ago) Reply with QuoteBack to Top

use

date("l dS of F Y h:i:s A", time()-9*3600);



time() will return the current timestamp and

-9*3600 will decrease seconds in 9 hours

simple, wasn't it? eh Smile

________________________________
Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test
OfflineView User's ProfileFind all posts by jayantSend Personal MessageVisit Poster's WebsiteYahoo MessengerMSN Messenger
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Fri Jun 14, 2002 2:22 pm (15 years, 4 months ago) Reply with QuoteBack to Top

...you can also use Gmdate()
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun Jun 23, 2002 4:55 pm (15 years, 4 months ago) Reply with QuoteBack to Top

Darren wrote:
...you can also use Gmdate()

ended up using Jayants way as I got some weird results with Gmdate
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Sun Jun 23, 2002 5:17 pm (15 years, 4 months ago) Reply with QuoteBack to Top

Seems to be working fine for me

What kind of 'weird results' did you get? just in case its something I haven't noticed.
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun Jun 23, 2002 5:20 pm (15 years, 4 months ago) Reply with QuoteBack to Top

Darren wrote:
Seems to be working fine for me

What kind of 'weird results' did you get? just in case its something I haven't noticed.

On a certain Cyberwings Server, it was displaying the day after on the date when I used that, fine on my eCommerceDiscovery Server though.
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.076969 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme