-
AuthorPosts
-
April 17, 2007 at 12:38 pm #119720
Hi,
Is it possible to change the Date in other languages?
Monday to Montag an so on ?
best regards from Germany
nathanbohn Friendnathanbohn
- Join date:
- March 2006
- Posts:
- 230
- Downloads:
- 0
- Uploads:
- 0
- Thanked:
- 9 times in 1 posts
April 17, 2007 at 1:35 pm #218191You will have to check with your hosting company to make sure you PHP has you local language installed. You will have to edit the index.php of the template. Go to templates/ja_teline/index.php
Around Line 214 or find<div class="ja-day">
<?php
echo "<span>".date ('l')."</span>";
echo " <div>".date ('M')." ".date ('d').date ('S')."</div>";
?>
</div>and replace it with
<div class="ja-day">
<?php
setlocale(LC_TIME, "de_DE");
echo "<span>".strftime ('%A')."</span>";
echo " <div>".strftime ('%b')." ".strftime ('%d').strftime (' ')."</div>";
?>
</div>The setlocale(LC_TIME, ” “)shows what locale you are changing to. If your site is on a windows box you will need to look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp
to find the correct locale code, in this case you would replace de_DE with germany.PS. The above code drops the english 2 letter suffix after the date number. so 17th becomes just 17, which makes the month and date appear on the same line. Someone may be able to help you straighten that out.
1 user says Thank You to nathanbohn for this useful post
nathanbohn Friendnathanbohn
- Join date:
- March 2006
- Posts:
- 230
- Downloads:
- 0
- Uploads:
- 0
- Thanked:
- 9 times in 1 posts
April 17, 2007 at 1:36 pm #218192if you wanted to still keep the 2 letter suffix you can change the last
.strftime (' ').
to.date ('S').
April 17, 2007 at 3:02 pm #218200Oder Du machst es so:
[PHP]<div class=”ja-day”>
<?php
setlocale(LC_TIME, “de_DE”);
echo “<span>”.strftime (‘%A’).”</span>”;
echo ” <div>”.strftime (‘%d.’).strftime (‘%b’).” “.strftime (‘%Y’).strftime (‘ ‘).”</div>”;
?>
</div>[/PHP]nathanbohn Friendnathanbohn
- Join date:
- March 2006
- Posts:
- 230
- Downloads:
- 0
- Uploads:
- 0
- Thanked:
- 9 times in 1 posts
April 17, 2007 at 3:29 pm #218205all available date displays are found at
http://us2.php.net/manual/en/function.strftime.phpApril 18, 2007 at 7:27 pm #218375<?php
setlocale(LC_TIME, "zh_HK.UTF-8");
echo "<span>".strftime ('%A')."</span>";
echo " <div>".strftime ('%b')."<br />".strftime ('%e').strftime (' ')."</div>";
?>For UTF-8 website, add .UTF-8
April 18, 2007 at 8:29 pm #218379Tks for the belp 🙂
April 23, 2007 at 5:01 pm #218741I needed it too. Thank you!
April 23, 2007 at 11:13 pm #218764Hi!
I live in Norway. On my page: http://www.kvinesdalsiden.net
the date is “Monday 23 April” this is wrong because it is Tuesday 24 April in Norway. Has this something to do with me using sitegrund, which is based in the USA. How can I apply a time difference to this date..?zorcolino Friendzorcolino
- Join date:
- April 2007
- Posts:
- 42
- Downloads:
- 0
- Uploads:
- 0
- Thanked:
- 1 times in 1 posts
April 24, 2007 at 6:53 am #218774Hi
thank you for code . Was chaning it and get the correct Date in German. within the calendar situated in the right top within Teline. However, the day besides the calendar remains still in English ( Tuesday instead of Dienstag). Can you please tell me how to change this. I would really apreciate your input.
Kind regardsErikThorsen FriendErikThorsen
- Join date:
- December 2005
- Posts:
- 1098
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 22
- Thanked:
- 10 times in 1 posts
April 24, 2007 at 8:07 am #218790You can set server timezone difference in the global configuration in your backend. I assume this would solve your problem. Lykke til!
seralpro Friendseralpro
- Join date:
- February 2007
- Posts:
- 12
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
April 24, 2007 at 10:34 am #218795Thanks for the help, i just changed mine to Spanish 🙂
<div class="ja-day">
<?php
setlocale(LC_TIME, "es_ES");
echo "<span>".strftime ('%A')."</span>";
echo " <div>".strftime ('%b')." ".strftime ('%d').strftime ('')."</div>";
?>
</div>
zorcolino Friendzorcolino
- Join date:
- April 2007
- Posts:
- 42
- Downloads:
- 0
- Uploads:
- 0
- Thanked:
- 1 times in 1 posts
April 28, 2007 at 5:22 pm #219058Hi Erik
sorry for getting back to the date question again. I checked all posts in this forum, checked everything, but still get a messy date back. Iset code for German language :
<div class=”ja-day”>
<?php
setlocale(LC_TIME, “de_DE.UTF-8”);
echo “<span>”.strftime (‘%A’).”</span>”;
echo ” <div>”.strftime (‘%b’).” “.strftime (‘%d’).strftime (”).”</div>”;
?>
</div>I
but still get day in English on frontpage, and date without day in content articles, like
Tuesday, . April 2007
I really dont know whats wrong.Do you have a proposal?
Many Thanks -
AuthorPosts
This topic contains 27 replies, has 20 voices, and was last updated by ambiental 13 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum