473,473 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

[Windows + PHP5] Localizing date()?

Hello

I'm trying to localize a small PHP application which uses
date() to display a date saved as Epoch in MySQL, but I can't get the
month to be displayed in French:

=========
//BAD setlocale(LC_ALL, 'fr_FR@euro', 'fr_FR', 'fra_fra');
//BAD setlocale(LC_ALL, 'fra_fra');
//BAD setlocale(LC_ALL, 'french');
//BAD setlocale(LC_ALL, 'fr_FR');
//BAD setlocale(LC_ALL, 'fr-FR');
//BAD setlocale(LC_ALL, 'fr');
//BAD too
setlocale(LC_ALL, 'French');

//27 December 2007 instead of
//27 décembre 2007
echo date('d F Y', '1198790064');
=========

I read the comments in www.php.net/date , and was wondering...

1. Why PHP5 seems to have a problem with locales, and

2. What would be the least complicated way to change this call to
date()?

Thank you.
Dec 28 '07 #1
1 1348
On Fri, 28 Dec 2007 04:10:57 +0100, Gilles Ganault <no****@nospam.com>
wrote:
>2. What would be the least complicated way to change this call to
date()?
For those interested, it seems like date() always displays date/time
using the US locale, while strftime() uses the selected locale.

For instance, the following does display the date according to the
French locale:

===========
setlocale(LC_ALL, 'French');

//27 December 2007
echo date('d F Y', '1198790064') . "<p>";

//27 décembre 2007
echo strftime('%d %B %Y', '1198790064');
===========

HTH,
Dec 28 '07 #2

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

Similar topics

1
by: Matthew Bates | last post by:
Hi, I would like to use PHP5 to interact with an XML-RPC web service. I've noticed a number of libraries on the net however many are out of date and not specific to PHP5. Could anybody...
24
by: Nak | last post by:
Hi there, I have some inherited forms that I wish to make "localizable", unfortunately none of the items I wish to be "localizable" are actually being "localized". For example, I have a few of...
7
by: Mathieu Maes | last post by:
Hi there I'm quite experienced in programming in PHP4, but I would like to make a step to PHP5. I created following class which works perfectly in PHP4 : Class Nessi { // ident part
3
by: abeb | last post by:
Hi all, I recently given a task to upgrade a running server (PostgreSQL7.3+Apache2.0+PHP4.2) to a new server with PostgreSQL8.1+Apache2.2+PHP5.1 installed (all Fedora Core 6 packages). All is...
2
by: eltower | last post by:
adactio.com/journal/1202 has a very interesting PHP script which gathers RSS data from various feeds and prints them in an HTML table. He calls this a lifestream. Anyways, unfortunately, my...
6
by: michael.schmitz | last post by:
Hello, my tiny PHP5 test application cannot establish a connection to a database while I am able to connect to the same database using the DB2 command line tool. Our server is 64 bit system...
0
by: =?Utf-8?B?U3VzaGlTZWFu?= | last post by:
I have question about pages localizability. So for example I have 3 pages on my site ================== main.aspx users.aspx products.aspx ================== I want make Localizing for them....
12
by: Alan M Dunsmuir | last post by:
After having worked with Apache/MySQL/PHP for a year or so under Linux I need, purely for convenience, to set up a parallel platform under Windows. Unfortunately, since I last did this (using...
0
by: cmdolcet69 | last post by:
I have an issue with localizing forms, I added a button to my form and then set my form to localizable property = true. changed my language from default to Spanish and saved. I built the...
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
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...
1
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.