471,354 Members | 2,035 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Help with PHP gmstrftime and setlocale

I am writing a guestbook script using MySQL, the part of the script below
is a loop which executes to read from the database all the input data to
print it out to screen.

1)
In the $gbDate line, the $T argument displays as $T instead of the actual
time in Windows. Is this a fault in Windows, or have I done something
wrong? Webpage will eventually be in Unix server online.

2)
If I uncomment the setlocale line, the output date string still stays in
English rather than whatever language I want it to output - how can I get
that to work? Does it work on localhost?

I am using PHP4.3.2, Apache2, MySQL 4 - all on Windows98SE machine running
as localhost.

Thanks

Dariusz

// setlocale (LC_TIME, 'nl,NL');

while ($row = mysql_fetch_array($result))
{
$gbID = $row['gbID'];
$gbDate = gmstrftime('%A %d %B %Y at $T',strtotime($row['gbDate']));
$gbURL = $row['gbURL'];
$gbName = $row['gbName'];
$gbComment = $row['gbComment'];

$display_entry .= "$gbID:<BR><B>Posted: </B>$gbDate &nbsp;<B>IP:
</B>Logged<BR><B>Name: </B>$gbName<BR><B>Personal website:
</B>$gbURL<BR><B>Comment: </B>$gbComment<BR><BR>";
}
Jul 17 '05 #1
0 1731

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Richard | last post: by
3 posts views Thread by Damien Elmes | last post: by
3 posts views Thread by J Trauntvein | last post: by
3 posts views Thread by Schraalhans Keukenmeester | last post: by
reply views Thread by Paul Lautman | last post: by
7 posts views Thread by John | last post: by
7 posts views Thread by Steven Woody | last post: by
5 posts views Thread by yogeshmk | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.