473,786 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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)?

Thanks in advance.

-Steven
Jul 16 '05 #1
1 5142
Make a function like
(substitute mdifference, hdifference for the difference in the clocks and
adjust +/- accordingly, though this is untested it shoudl work)
function localdate()
{
$hourdifference = "1";
$mdifference = "10";
$hour = date('h') + $hdifference;
$minute = date('i') + mdifference;
if($i < 10)
{
$minute = "0".$minute ;
}
$both = $hour.$minute;
return $both;
}

"Steven" <xu*****@comcas t.net> wrote in message
news:AKLOa.1391 9$H17.5375@sccr nsc02...
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)?

Thanks in advance.

-Steven

Jul 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
11720
by: dan glenn | last post by:
Say, I want to set a cookie and have it expire an hour after it's set. It's looking like this is only possible for browsers which are in the same time zone as my server?? In other words, if I set my cookie with: setcookie('CookieName', $SomeValue, time()+3600, "/");
17
4889
by: Mike A | last post by:
Hi, I'm hoping someone can help me with this. I have a URL for which I'd like to limit access to by time. For example,say I have a URL that I don't want accessable on Monday mornings between 10am-noon and Fri. afternoons between 2-4pm. So when someone clicks on the URL during those times a message pops up saying somthing like "sorry we're closed now etc" Is this possible? if yes, I'm guessing I'll need somesort of "onclick" for the
2
405
by: arcvonz | last post by:
We have a time critical smart client application running on Windows 2000/XP systems. Is there any reliable service that would help in syncing the local system time to atomic clock or local time at the least in case the user changes the system clock in purpose or inadvertently? - Network synchronization solutions in the network is manual I believe? - Web service based sync could work but will not if the user is off line. Any other...
7
1592
by: WindAndWaves | last post by:
Hi Gurus Is it possible to display the time on a site using javascript. I want to show visitors the current time in New Zealand, but the javascript that I use actually displays the time on the users computer (i.e. completely useless). Any ideas greatly appreciated Thanks in advance
12
7410
by: aegis | last post by:
What is wall clock time? the standard doesn't define it but I see its use in past posts on clc. -- aegis
23
3772
by: Randall Nortman | last post by:
I assume I'm not the first person to have encountered this, but I couldn't find anything in the FAQ or on the mailing lists recently. My apologies if this is already documented somewhere... My application logs data to a Postgres table continuously (once every 15 seconds), maintaining a persistent connection. Each datum is logged with a time stamp (Postgres type "timestamp with time zone"). The application does not explicitly set the...
74
7762
by: Dominik Wallner | last post by:
Hi! I'm currently implementing a program which measures voltages through an external USB-AD-converter. It should output those values as time/voltage pairs. My problem is to measure the time to output (time elapsed since program start would do just fine) - it should be as precise as possible, as there may be only differences in milliseconds between two measurements.
4
4405
by: Polaris431 | last post by:
I have a web application in ASP.NET that will be used globally. Data is collected on mobile devices running Windows Mobile and sent to the web server where it is stored and can be viewed. Data is timestamped when it is sent from a PDA device to the server. I am writing software for both the web app and the PDA. The web server is located at one location while the PDA devices are located around the world. The question is, how do I handle...
37
4693
by: David T. Ashley | last post by:
I have Red Hat Enterprise Linux 4. I was just reading up about UTC and leap seconds. Is it true on my system that the Unix time may skip up or down by one second at midnight when there is a leap second? By "Unix time" I mean the integer returned by time() and similar functions. I'm concerned about the "down" case. Some of the software I've written
0
9492
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10360
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10108
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4064
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.