Time Different Between My Apache Server And My Local Clock
I actually have two questions:
1. I try to get current time, but the time I got is 1 hour different from my
local time. I assume it is caused by Time Zone. So is there any easy way to
fix this? I assume that I can first get the Time Zone of the server by using
the T option in date, and then using my local Time Zone to calculate the
difference. But I am wondering if there is some buil-in function to do it.
2. I found out this also today while workng on the same project. My apache
clock is 10 mins slower than my local clock. Any suggection to calibrate the
apache server clock (I don't own the server)?
View Complete Forum Thread with Replies
Related Forum Messages:
Local Apache Web Server
At the moment I am using "easyphp" on my computer to test my php code. However, I would like to get a little more advanced and replicate an apache server on my home computer. Such that I can build a website using .htaccess on my home computer. I can build it at home, then upload it all nice and finished to an apache server. Does anyone know where I can get an apache server for my home computer? A kind of local host for apache? Also, I would like an IMAP email client on my server and to have some PHP code that is able to "read"/parse my incoming emails. Open them up - "read" them by looking for keywords - then delete them etc. Code:
View Replies !
Local Apache Server
My php script uploads my files fine. I did a chmod 777 to the directory I want uploaded files to go, but when I upload to that directory (with php) none of the files have permissions, but the files are there. What's going on.
View Replies !
Local Apache Web Server Revisited
I would like to replicate an apache server on my home computer. Conclusions of a previous thread on this topic: 1) Use the same operating system for your local apache server as your host uses. Any comments on just how important this is would be very welcome because i am thinking of cutting a corner and running my local apache server on windows XP. My prospective host uses Linux. 2) There are some nice "neat, easy, tidy" installs of apache (with PHP and MySQL) available. easyphp AppServ XAMPP Any comments on which one is best would be highly appreciated. As would further suggestions. 3) Things that I want to do which are a bit special: ) Use the PHP IMAP functions. These are a PHP extension. http://uk2.php.net/imap So, I will have to add this extension. How easy is this with these local apache servers? ) Does anyone know an IMAP email client that I can put on my local host apache server? courier-imap or CyrusIMAPD are apparantly possibilities. Can anyone point me to any reseources that would guide me through setting up these clients so that they are integrated with the apache web server - so that PHP code on the apache server could have access to emails in the IMAP email inbox. PHP code on the server can send emails from the IMAP email inbox.
View Replies !
Apache Local Test Server On XP Pro
I'm hoping someone can help me with the following. My son is learning PHP and wants to install an apache test server on our XP pro home computer so he can test his code before uploading it to his hosting company. I don't have a problem with this in principle but I do have the following concerns: 1) We connect to the internet via AOL and my son's account is a "young person access" account. Will this be compromised by apache? 2) Will the installation of this apache server allow my son to breach Windows security at all (he is a restricted user at present)? 3) Any other possible security issues?
View Replies !
Local Apache Server Error, But Ok When Hosted
I have just used a script that includes the first line session_start(); On my computer where I have apache php and mysql installed I get the error: Warning: session_start(): open(/tmpsess_4e8a9cf51a21ab1c9fe26630d5446262, O_RDWR) failed: No such file or directory (2) in c:serverapachehtdocsmaindex.php on line 2 But when I upload it to my host the page works without errors. Is there a problem with my apache setup or is it a php thing?
View Replies !
Server And Local Time Difference
i've been trying to make my own plugboard but i've encountered a problem. Quote: $date = date("Y-m-d h:i a", $timestamp); to manage the click count i use $timestamp to make a unique id for each link. and the only way to convert $timestamp to Y-m-d h:i a format is to use the viarable $date. but the problem is there is a +13 hours difference between my time and the servers time.
View Replies !
Server Time To Local Time
I live in the UK, my hostings in USA, the server time is 6hrs behind my local time. I know that I could set up my forms so that when the dates entered into the database it is entered with +6 hours, but I just wondered if there's a simpler way? - it's just because I have a lot of forms that would need editing. Any sort of magic '+6' switch I could use so the database itself could take care of it upon insertion?
View Replies !
Real-time Clock
Where should I start to write a Real-time Clock? I want it be dynamic, not static. I know how to get the time and display it but how do I keep changing it ?
View Replies !
Grab Time From World Clock
I need to grab times for few cities from world clock site. Not sure how I can do that. So lets say I want to grab New York time from that site. Not the weekday name. just New yorks time. and show it on my site. How would I do that.
View Replies !
Countdown Clock That Counts Down To A Specific Time
how can I make a countdown clock that counts down to a specific time and isn't affected by the time that the user has their computer set to? I would like the countdown to look like: ___ days ___ hrs ___ min ___ sec until (event)!! I want it to countdown to March 18, 2005 at 5:30 AM U.S. Central Standard Time (GMT -6). No matter what the user has their computer's time set to, I always want the countdown to be for March 18 at 5:30 AM central time.
View Replies !
Auto Delete The Old Records But What If Server Clock Was Set Up Wrong In Maintenance?
I want auto delete any events that the event date is at least 1 day older than current date. No problem for the php programming. get the current data (server clock), check the events date and delete the old records. My problem is that for some very rare cases. Say if for extrem cases I have 1000 new events saved in database. But somehow, I or the the hosting company do the server maintenance, and reset the time clock of the server, in case in the maintenace, the server time clock was set up wrong say 2005, was set up as 2006. Code:
View Replies !
Adjusting Time Displays For User's Local Time
I have a news/comment site where stories and comments are accompanied by the date they were posted. Currently I'm doing that in the GMT format, simply because it's easiest. What I'd like to do, however, is have the page display posts and comments with "your time," i.e., the local time of the user (example of what I'm talking about here). I know how to get local time variables from a user with javascript, but I'm not sure how to pass that information to PHP, especially since I'd like to do this on the front page, which means no passing javascript information via query strings.
View Replies !
Php MySQL Works On Remote Server, Only Partially On Local Server
code to populate form select fields with data from a MySQL database, so a user can use those to sort/filter and view the 3,000 records. No inserts -- just selects; very simple. I originally set this up using URL-based query strings at http://stjuliana.org/school/ar/BUindex.php but since that only allowed sorting and not filtering, hence all 3k records load, I made a form verson at http://stjuliana.org/school/ar/index.php . Everything works just fine, however, there's still a lot of tweaking I want to do, such as splitting the form input and output into two pages (_blank), having a printable version, etc. To that end I just set up the latest builds of Apache, php and MySQL on my local Windows XP box, lest I blow my beer budget for the month on bandwidth overage. <g> I have a very simple page I used to test my localhost setup and everything's fine. I can connect to MySQL, create, insert and select from DBs, so I know my config is fine. All my other .php pages on this site work fine locally as well. The two abovementioned pages, however, are giving me fits when run locally... For the URL-query-string version, it loads up with the default view (=name_ns), which grabs all records and sorts by name and point asc. No matter which of the other sort 'views' I might choose, it still loads up all the records in that default sort. The server's holding on to something and I don't know how to clear it. The remote version correctly sorts based on the query string chosen. The form version is worse. It connects to the DB and populates the select boxes with the field data -- that part's fine. But no matter which submit button is selected, no data is retrieved. I get no error, but no data either. The form's action is set to $_SERVER['PHP_SELF'] and I've tried both GET and POST -- no change. Since the exact same pages work on the remote server I know it has to be something on the local setup. But where do I look if there's no obvious error? This is probably something incredibly basic but I'm bleary-eyed from reading tutorials and forums all over the Internet and can't come up with anything.
View Replies !
Show Time In Local Time
I tried searching for the answer, but didn't really get anything back. Maybe it's the terminology I was using. Can anyone help me in a direction for how to change what time zone a time is displayed for? My timestamps default to California and would like to show them as EST. Or even show the time in whatever time zone the person viewing the time is in. Does that sentence make sense?
View Replies !
Can't Read Remote Web Page From Local Apache/PHP
I'm trying to read the contents of any Web page on another host. I'm finding that... echo file_get_contents( 'http://www.php.net' ); .... works fine if I upload the PHP script to my Web host, and run it there. But if I run it on my PC, which is running Apache 1.3.33 (Win32) and PHP 5.0.5, then it always times out, and gives me the error message... [error] PHP Warning: file_get_contents(http://www.php.net) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. I get the exact same results using... $fh = fopen( 'http://www.php.net', 'r' ) or die( $php_errormsg ); while (! feof($fh)) { $page .= fread($fh,1048576); } fclose($fh); echo $page; Anyone know what could cause this to happen?
View Replies !
Problems Uploading Files Using Apache And Php On A Local Windows PC.
I've got some problems uploading files using apache and php on a local Windows PC. I'm using the file upload example from the manual, but i can't get it to work. I don't get an error message, it's asif nothing happens. I can't find the file that should be uploaded on my harddisk. Has anyone a working example for file-uploads on a local server with the settings for the php.ini file? Any tips?
View Replies !
Displaying Local Time
How do you display a users local time. I have looked through some help files and they seem to all seem to be showing me how to use the time in conjuction with something else.
View Replies !
Converting UTC To Local Time
My PHP connects with a postgresql database and fetches the last login information of type "timestamp with time zone". The database returns this value: 2007-08-06 19:05:14.551719-06, but the actual time I have right now is 9:05:14 PM. I assume the time given by the database is in UTC. Now, how do I convert this to respect the local time of the user seeing this? For example, I am located in eastern time zone and I should be seeing 9:07:14 PM, but someone in central time zone should be seeing 8:05:14 PM. Is there a PHP code that can convert this time into the local time of the current user viewing the time depending on his geographical location?
View Replies !
Local Machine Time
Echoing <?php echo date('Y-m-d h:i:s'); ?> seems to give the server time. Is there a way to echo the local machine time of the user/by time zone? The user is entering values based on the time (this is a web based calendar). Currently, the above could be a max. of 2 hrs off for users in the United States, in may case.
View Replies !
Always Local Time & Date Format?
Is there a script available that would re-format a time & date always according to the users' setting? Some setting that would be read by the language set in the browser or from the IP?
View Replies !
Local Time Script Issue
i have this little script to show me the local time in those cities.. $now = time(); $tz = getenv("TZ"); putenv("TZ=Europe/Bucharest"); printf("<tr> <td valign=middle width=100><font class=text><b>Bucuresti</b> :</td> <td valign=middle width=100 align=center><font class=text><b>%s</b></td><tr>", date('H:i:s', $now)); print '</table>'; how can i make time change each second ? whitout refreshing the page..
View Replies !
How To Show Local Time To Viewers
The version of PHP on the server is 4.1 Now only time at server is displayed I am searching everywhere but still stuck is there some way to get the timezone form the client browser without user interaction ?
View Replies !
Determining Local Date/time, Given GMT And Offset
I'm trying to create a function that returns the local date/time if you feed it a GMT date/time and the local offset. For example i live in MST so i think it's GMT-7. This is the function i've created, but it's returning weird values. didn't work for me last night, but mysteriously worked this morning. maybe something screwy with AM vs PM? I'm passing the date in the format "Y-m-d H:i:s". I'm not so good with date calculations obviously. Code:
View Replies !
Web Server In Local
I work actually in local and when I put my php (and html) files on the local directory configured as localhost, an error message (which says that no files are on the server) appear. The server is Apache on Windows XP, and I see on the server only the Apache manual (and the message that says "Apache is correctly running!"). I had been just pass to Apache and I don't know what I do.
View Replies !
User Local Time Diplay In Input Field
I'm wondering how can I have the local time of a user into a input field, it might sound or be stupid but even after my search I couldn't find a code si9mple enough, without any bla bla which each not my need.
View Replies !
Record Website Visits According To Local Time (U.S. Central)
I've got a newb question about Daylight Savings Time (DST). First of all here is some server info: Apache 1.3.28 PHP 4.3.6 MySQL 3.23.49 Time is set to GMT My goal is to be able to accurately record website visits according to my local time (U.S. Central) every day of the year, no matter if I am in DST or not. I need a full datetime set of information (hour, min, second, etc). I have devised this line of code... $date=date("Y:m:dH:i:s",time-18000); ....but it does not help me when DST changes for me, as GMT does not observe DST. Next I tried this: echo("server time is: " . date("H:i:s") . "<br> "); putenv("TZ=US/Central"); echo("new server time is: " . date("H:i:s") . "<br> "); And got these results: server time is: 17:46:44 new server time is: 17:46:44 Apparently, the server does not allow me to change my timezone to Central time (because the resulting times are the same). The application I am developing relies heavily on *accurate* time information.
View Replies !
Max Execution Time Means Server Execution Time Or Client Browser Hung Up Time?
The max execution time is set up to be 30. When I submit the requests of execution through the client browser, it shows the execution was running. It still hung up there after 30 seconds, after 2 minutes ... And the browser hung there forever. I have another page which saves the reports of the execution, so I open another browser window, and check out the report. It shows me the execution is still going even after 1 minute, 2 minutes... Code:
View Replies !
Export Local DB To Server DB
can anybody refer me to a tool so that i can upload data from my local mysql DB to server DB without phpmyadmin. I have FTP and other access to server. my DB is like 100 MB.
View Replies !
Local IMAP Server
I've installed EasyPHP on my Windows machine, which does the job really fine. Apache, PHP and MySQL easy going. What are the possibilities for installing a local IMAP and POP server for the same test/develop purposes?
View Replies !
Local IMAP/POP And FTP Server
I've installed EasyPHP on my Windows machine, which does the job really fine. Apache, PHP and MySQL easy going. What are the possibilities for installing a local IMAP and POP server and a FTP server for the same test/develop purposes?
View Replies !
Mail To Local Server
I have a question, May be i am wrong but i have doubt, If some body explain it either i can or not. Can i sent email to my local pc server then i read it. Explanation: For example i have a form where i put email, click on send button ,page executes and send mail. But is it possible to send this mail to local server on my pc,I mean offline internet. Without internet connection. I have apache with php,mysql And Windows server 2003. Then a script or software through which i read that mail. I want this only to check my scripts without uploading it to the internet server.
View Replies !
Reading Local File Not On Server
I am trying to parse a file which is located on the users local drive and then take this data and put it into the mySQL DB. However, I get errors when I pass in a file path such as C:Documents and SettingsAdministratorDesktopfooSLInfo.txt.
View Replies !
How To Setup A Local Server Environment:
I want to setup a localserver environment in my desktop (OS : Win XP)so that i could use ASP.Net , PHP , Ajax ,Mysql and SQL server in that local host. I want to know wat are the things i should download? and from where it to be download?
View Replies !
Set Up A Local Email Server For My Laptop
I want to set up a local email server for my laptop, I go on trips constantly for work, and don't always have internet access to test my scripts on. I have WAMP server installed and is good for testing those scripts, but I want to install a test email server to test if my email functions are working correctly... does anyone have a link to an email server that is good for this type work?
View Replies !
$_FILES From The Server - Not Local Machine
I'm just playing with someone else's code and was wondering how to get details of a file that's already uploaded to my server into the $_FILES super global. the code I have is: ...$uploadedFileName = $_FILES['filename']['name']; if($_FILES['filename']['size'] > $maxSize) {... all the checks are done using this and I just want to parse all this info without the user having any control / knowledge of it at all. It's for an image upload script which has been built already, but I want lots of differing quality thumbnails to be generated, but the current code keeps asking the user to input size variables and path details to upload a file from their local machine.
View Replies !
Mail() Not Working On Local Server
I've got a form on a local server that has a working internet and network connection and it uses the mail function and it doesn't work. It works perfectly when I execute it online but it won't work locally. Essentially, I'm trying to mail html and here is my code:
View Replies !
Script Works Local But Not On The Server.
I found a script to display a simple photo gallery with dynamic thumbnails. I modified the script to make it save the photo thumbnails. It works perfect here in my computer but when i upload to my hosting it doens´t seem to work. Code:
View Replies !
Passing A Value (eg Id) From A Apache Server To A Windows Server
I am trying to pass an Id from one server to another. The case is like this I have two scripts one in php and the other in asp. I am trying to combine the both together by passing an Id from php script to an asp script. The problems come on the client side because the information is on two different servers. Is there a way around this? Can this be accomplished?
View Replies !
Transferring A MySQL Database From Local PC Onto An ISP Server
If I have an MySQL database on my local w2k, how do I transfer it onto my ISP server? The ISP gave me the name of an empty MySQL database they set up for me, the username and the password with no further explanations. I came here from ASP/Access where I was just uploading a mdb file into my webspace. But with MySQL there should be a different procedure,
View Replies !
Can't Connect To Local MySQL Server Through Socket
I created a test web form, that successfully input the data into my test database. However, today I created a second form, added the layout code, putting the layout and mysql connection details into a php include code. These are the only changes I have made, apart from field names etc, but today, I get the following error message: QuoteWarning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/fhlinux177/f/further-flight.co.uk/user/htdocs/napsters/enter.php on line 50 Warning: mysql_query(): A link to the server could not be established in /home/fhlinux177/f/further-flight.co.uk/user/htdocs/napsters/enter.php on line 50 Your nap has been added to the database. Good Luck! I checked, but the nap hasn't been added to the database. I use the code I found on phpmac.com. It currently looks like this: Code:
View Replies !
|