473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help: Date function not returning correct date & time

I have just notices that the date() function is not returning the correct
date/time on my "server".

I am running apache2 on my winxp pro laptop.

My system clock is set to the correct date, time and timezone, get the
results returned by date() are 11 hours behind.

Any ideas what is going wrong?

Thanks
Jul 17 '05 #1
4 3888


Funnyweb wrote:
I have just notices that the date() function is not returning the correct
date/time on my "server".

I am running apache2 on my winxp pro laptop.

My system clock is set to the correct date, time and timezone, get the
results returned by date() are 11 hours behind.


Without seeing a sample of you're code, it is impossible to say what
might be wrong.

Ken

Jul 17 '05 #2

"Ken Robinson" <ke******@rbnsn.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...


Funnyweb wrote:
I have just notices that the date() function is not returning the correct
date/time on my "server".

I am running apache2 on my winxp pro laptop.

My system clock is set to the correct date, time and timezone, get the
results returned by date() are 11 hours behind.


Without seeing a sample of you're code, it is impossible to say what
might be wrong.

Ken

There is nothing special about my code. All I do is call the date function.
For example:

$today = date("j M Y - H:i:s");

The result of this call is 11 hours behind my local time. I am in New
Zealand and the time being returned is what it would currently be in the UK.

Any ideas?

Jul 17 '05 #3
mX
Yes, date() returns GMT date by default, I think.

UK and Portugal (where I live) are placed on the GMT line, that's why
you are getting that.

There is a function on php, which returns de date of the server... I'll
try to look for it.

Jul 17 '05 #4
mX wrote:
Yes, date() returns GMT date by default, I think.

UK and Portugal (where I live) are placed on the GMT line, that's why
you are getting that.

There is a function on php, which returns de date of the server...
I'll try to look for it.


gmdate() does it in GMT. date() does it in the local time of the server.

From the manual http://www.php.net/date
"Returns a string formatted according to the given format string using
the given integer timestamp or the current local time if no timestamp
is given."

--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
Jul 17 '05 #5

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

Similar topics

3
by: laurie | last post by:
Hi all, I'm trying to help out a friend who has inherited a client with a PHP shopping cart application. Neither of us know PHP, but I've been muddling my way through, trying to get these old...
1
by: Gerry | last post by:
Help needed with this: I have had a guestbook-page in Europe and will now have to move it to a US based-server. This makes the time-function showing time 6 hours wrong. The time should be GMT...
4
by: Gerry | last post by:
As I'm not a PHP-prgrammer at all, I just need Help with this: I have had a guestbook-page in Europe and will now have to move it to a US based-server. This makes the time-function showing time...
3
by: Andrew DeFaria | last post by:
I have the following php code: function Today2SQLDatetime () { $today = date ("Y-m-d H:i:s"); print "date (\"Y-m-d H:i:s\") returned $today<br>"; return $today; return date ("Y-m-d H:i:s"); }...
9
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my...
12
by: LongBow | last post by:
Hello all, From doing a google serach in the newsgroups I found out that a string can't be returned from a function, but using a char* I should be able to do it. I have spent most of the day...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...

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.