How to change the name of days and months?
Moderator: General Moderators
How to change the name of days and months?
How to change the name of days and months into my language, example from Monday to E Hënë etc... The function that I use is date();
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: How to change the name of days and months?
I'm not sure what language you are using, but you can use set the locale using (example is dutch)
Code: Select all
set_locale(LC_TIME, , 'nl_NL');- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: How to change the name of days and months?
You might just have to make arrays of whatever language you want to convert into and do it that way, unless there's something on http://www.php.net/manual/en/ref.calendar.php
Re: How to change the name of days and months?
My language is Albanian, usually it uses SQ prefix. Where I have to put: or that array? I use this for my date and time
Code: Select all
set_locale(LC_TIME, , 'nl_NL');Code: Select all
$time= date("l d F Y, H:i:s");
//then I insert it to DataBase by://
$sql="INSERT INTO lajmet (name, news, time)
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: How to change the name of days and months?
You'll need to use strftime() to format the date per the locale settings. In your case, the format would be
Code: Select all
$time = strftime("%A %d %B %Y, %T");Re: How to change the name of days and months?
When I Use Like this:
It works good, but when I try to add the time like you wrote:
It Does't show neither date or time.
Can you tell me where I can find the code that php uses for states because I don't know what I have to use for Albanian language.
Code: Select all
setlocale(LC_ALL, 'nld_nld');
$time= strftime("%A %d %B %Y")Code: Select all
$time = strftime("%A %d %B %Y, %T");Can you tell me where I can find the code that php uses for states because I don't know what I have to use for Albanian language.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: How to change the name of days and months?
Take a look at http://ca.php.net/manual/en/function.strftime.php, it seems not all the formats are supported on all platforms.
Re: How to change the name of days and months?
Everything it's ok but my months and days now are in lowercase can I change that the first word would be in uppercase?
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: How to change the name of days and months?
Code: Select all
strtoupper()Re: How to change the name of days and months?
putenv("TZ=ASIA/Dhaka"); // My timezone
$thedate=date("U"); //get unix timestamp
$displaytime=date("F j, Y, g:i a");
$thedate=date("U"); //get unix timestamp
$displaytime=date("F j, Y, g:i a");
Re: How to change the name of days and months?
Thnx a lot, this is exactly what I want ucwords() I found in php.net while I was seeing for strtoupper().jayshields wrote:?Code: Select all
strtoupper()
Now I have another problem, my language has a letter that is "ë" but in web-page it shows me like a symbol, when I log in phpmyadmin I can see that there is ë but in WeBPage it doesn't show like ë, but like a symbol. I converted the .php file into "UTF-8 Without BOM" cause everytime this worked for me, but now for the date it doesn't work this thing.