PHP forums, MySQL forums, Web Development resources

Home PageHome    PHP ResourcesTopic List    FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups 
 RegisterRegister
    ProfileProfile    Log in to check your private messagesLog in to check your private messages    Download the RSS Reader RSS Feed Download the RSS Reader RSS for this forum Log inLog in 

PHP Forum :: MySQL Forum :: Java Script Forum



time

 
Post new topic   Reply to topic    WeberForums.com Forum Index -> PHP General
View previous topic :: View next topic  
Author Message
Dusty
Guest





PostPosted: Thu Jan 28, 1999 12:45 am    Post subject: time Reply with quote

How can I get the date and time for my local time zone instead of the date of the server (which is GMT)?
Back to top
Boaz Yahav
Guest





PostPosted: Thu Jan 28, 1999 11:25 am    Post subject: RE: time Reply with quote

I think i didnt understand your question but here goes anyway Smile

If you have the GMT time of the server, Why not simply take the GMT time and add or substruct the GMT Delta of your location?

For example, Israel is GMT + 0200. I can know the time in israel even if my server is in the USA. I simply take the GMT time from the server, add 2 and have the time in Israel.

Was that close to what you asked?

berber
Back to top
Dusty
Guest





PostPosted: Thu Jan 28, 1999 8:52 pm    Post subject: RE: time Reply with quote

Right that makes sense but will this work when GMT is on the next day? So if it is Thursday locally and it is already Friday GMT, will subtracting the difference in hours also set the day back? Perhaps you could show me exactly what your PHP looks like. I'm fairly new at this. Thanks!
Back to top
Boaz Yahav
Guest





PostPosted: Fri Jan 29, 1999 9:02 pm    Post subject: RE: time Reply with quote

GMT relates to time, not date. If you wish to get the full date and time you can simply check the timestamp diffrance between your computer and the server, take the timestamp from the server, deduct the diffrence and translate the timestamp back into the date and time of where you are now.

You can find a function that translates the timestamp to date at : http://webdev.berber.co.il/get_example.php3?count=26

basicaly the timestamp is a number which represents the number of secconds since 1/1/1970 00:00:00.

berber
Back to top
Display posts from previous:   
WeberTrivia Questions WeberTrivia Questions
 Think you are smart? Prove it!. Try your skills with these questions :
 WeberTrivia QuestionsRecursive arrays and multi-dimensional arrays are one and the same. (PHP and MySQL)
 WeberTrivia QuestionsThe \"cache_dir\" tag of the squid configuration has a default of /var/spool/squid. (Linux)

WeberTrivia Questions



PHP Code Examples
 Stream diffrent sizes of images from a single image to save disk space.
 JavaScript dropdown list menu to switch any page.
 Dump the contents of a PHP variable in html format with a recursive list of subfolders and files from a given root directory.
 PHP Dump in html format the contents of one array variable with a recursive list of the nested array variables inside.
 Link Extractor - This function is used to extract links from a given URL. This will convert relative path into absolute path and also remove PHPSESSID stuff.
 Building a Dynamic Form using Javascript and innerHTML. Add form elements in realtime without refreshing the page.
 A PHP Calendar function with CSS : add a cool calendar to any php page by just adding a calendar class based function.
Post new topic   Reply to topic    WeberForums.com Forum Index -> PHP General All times are GMT + 2 Hours
Page 1 of 1

 
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






Powered by phpBB © 2001, 2005 phpBB Group
PHP Forum :: MySQL Forum :: Java Script Forum