473,395 Members | 1,535 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,395 software developers and data experts.

Timestamp on local Win2k server returns 1970. Help!

Dear Group,

I have apache running on a win2k machine. When I try to use time(); or
date();, I get the 01-01-70 returned. Must be a setting in the apache
config, but where?

Thanks,
Gert
Jul 17 '05 #1
8 2232
Gert Jan Wiersema wrote:
I have apache running on a win2k machine. When I try to use time(); or
date();, I get the 01-01-70 returned. Must be a setting in the apache
config, but where?


Since there is nothing in both apache config and php.ini that influences
system dates, you are left with only a few options:

* Check the system date (obvious, but still).
* There's something wrong with the installation of PHP, re-install it from a
fresh download.

It's also useful to check bugs.php.net for related bugs.
JW

Jul 17 '05 #2
> * There's something wrong with the installation of PHP, re-install
it
from a fresh download.


Shit. I'm in the middle of a project.

For the time being I've placed a file on a PHP remote server which
generates a timestamp I can use. Since this is a "serious" server,
it's maybe even better, more accurate :)

But thanks. It was time to clean up the ol' machine anyway. This is a
good motivation.
Gert
Jul 17 '05 #3
On Sun, 29 Aug 2004 00:17:57 +0200, "Gert Jan Wiersema" <gj*******@donder.op>
wrote:
I have apache running on a win2k machine. When I try to use time(); or
date();, I get the 01-01-70 returned. Must be a setting in the apache
config, but where?


Can you post example code demonstrating this? time() will never return the
string '01-01-70', and date() without parameters wouldn't either - the first
parameter is mandatory.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #4
> Can you post example code demonstrating this? time() will never
return
the string '01-01-70', and date() without parameters wouldn't either - the first parameter is mandatory.


What I do:

$datenow = time();
$date = ("d-m-y", "$datenow");

Then I get a nice 30-08-04 when I print $date.

But the time() returns the 1970 value... So it's like the apache
server here is not really doing what it's supposed to do.

Gert
Jul 17 '05 #5
On Mon, 30 Aug 2004 22:59:16 +0200, "Gert Jan Wiersema" <gj*******@donder.op>
wrote:
Can you post example code demonstrating this? time() will never

return
the string '01-01-70', and date() without parameters wouldn't

either -
the first parameter is mandatory.


What I do:

$datenow = time();
$date = ("d-m-y", "$datenow");

Then I get a nice 30-08-04 when I print $date.

But the time() returns the 1970 value... So it's like the apache
server here is not really doing what it's supposed to do.


Apache's got nothing to do with it, it's PHP that's returning values.

What does the following print:

<?php
var_dump(time());
?>

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #6
> What does the following print:

<?php
var_dump(time());
?>


Yeah! That works...

But somehow...

$time = time();
print "$time";

also works!

Hmmm... something with negative energy?

:)

Thanks!
Gert
Jul 17 '05 #7
On Tue, 31 Aug 2004 01:40:21 +0200, "Gert Jan Wiersema" <gj*******@donder.op>
wrote:
What does the following print:

<?php
var_dump(time());
?>
Yeah! That works...

But somehow...

$time = time();
print "$time";

also works!


So it should...
Hmmm... something with negative energy?


What? So where's the problem?

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #8
$time = time();
print "$time";

also works!

So it should...
Hmmm... something with negative energy?

What? So where's the problem?

The problem was that the exact same piece of code wouldn't work
earlier. Somehow it started to work the other day. That would mean
that there was something wrong with the server here, which was my
thought in the original post.

Gert
Jul 17 '05 #9

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

Similar topics

2
by: Ben | last post by:
I would like to use php to query a database and retrieve a unix timestamp. The problem is that mysql is storing the data in the date format and not a timestamp. I am sure that I can amend my...
4
by: RT | last post by:
If anyone can help that would be great. Iım trying to format a timestamp from my MySQL table (sessions) Hereıs the code Iım using: <?php echo date('D,n-j-y h:i:s...
0
by: Michael J. Wendell | last post by:
Hello, I am trying to debug an issue with sessions in my ASP 3.0 web application, which runs fine on WIN2K Pro and WINXP Pro, yet fails to function correctly on WIN2K Advanced Server. My actual...
1
by: Dave | last post by:
I am working with an application that is returning a second based timestamp. It returns values based on the 86440 second day in GMT. Is there an ability within SQL Server to convert the value...
6
by: Job Lot | last post by:
Using VB.NET how can I find all available SQL Server on a local network and list all the databases in each server. Thanks
2
by: Alex | last post by:
Hi all, Got a small problem here. I have a number of web caches here that generate loads and loads of log files and instead of keeping them for analysis I want to write them to a db/2...
6
by: Robert Schuldenfrei | last post by:
Dear NG, As expected, when I went to implement TIMESTAMP, I failed. With the help of Kevin Yu, I got the 2 code segments at the bottom working using a WHERE clause that checks all columns. ...
6
by: bg_ie | last post by:
Hi, I wish to write a C program which obtains the system time and hence uses this time to print out its ntp equivalent. Am I right in saying that the following is correct for the seconds part...
5
by: kyosohma | last post by:
Hi, I am populating a mySQL database with data from the MS Access database. I have successfully figured out how to extract the data from Access, and I can insert the data successfully into mySQL...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.