473,386 Members | 1,712 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,386 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 1802

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

Similar topics

4
by: Richard | last post by:
Hello: Environment: Linux server PHP 4.3.4 This code: echo '<br>'.strftime('%T %Z',mktime()).', Timestamp='.mktime();
3
by: Damien Elmes | last post by:
Hi folks, I've got a module + C extension which provides on screen display support in X, via libxosd (http://repose.cx/pyosd). I've recently had a report of trouble where a Russian user was...
3
by: J Trauntvein | last post by:
I was working with a co-worker the other day to work through the process of formatting numeric values by imbueing C++ iostreams with locales. His program's initialisation code had a call to...
3
by: Schraalhans Keukenmeester | last post by:
Hi, I run Apache 1.3.33 and PHP 5.0.4 on my Suse9.2 Linux box. If I try any of the following: setlocale (LC_TIME,'nl'); setlocale (LC_TIME,'nl_NL'); //example php.net site setlocale...
0
by: Paul Lautman | last post by:
Last night I had a web site. This morning it was returning nothing. I traced it to a call to setlocale(). It appears that something has happened that means that any call to setlocale completely...
4
by: Richard Kessler | last post by:
I am relatively new to Python. Love it, but I find things that I can do easily in .NET and cannot find a way to do in Python. I need to format a number as currency, for example 12343.56 to...
7
by: John | last post by:
Hello, I have this script and it shows GMT time and I need it to show -8 GMT for PST time. Here is the code that needs changing.
7
by: Steven Woody | last post by:
Hi, I am in Linux writing a program using setlocale(3). But I found, only the first invocation of setlocale(3) can be success, any subsequent calling of this function will fail $B!J(B return...
5
by: yogeshmk | last post by:
I'm writing an application which is required to function with many languages and also compile on Linux & windows. Here's how I find the locale .. # include <stdio.h> # include <locale.h> int...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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.