grucker Posted December 25, 2011 Report Share Posted December 25, 2011 I have a time and date using the code echo date("l jS \of F Y H:i:s."); Now I need to show this in several different languages, including French German and Dutch I have tried setlocale(); and echo strftime The date shows but still in English. Any idea how to show the day date and time in Php for the languages suggested. Quote Link to comment Share on other sites More sharing options...
grucker Posted December 28, 2011 Author Report Share Posted December 28, 2011 I have a time and date using the code echo date("l jS \of F Y H:i:s."); Now I need to show this in several different languages, including French German and Dutch I have tried setlocale(); and echo strftime The date shows but still in English. Any idea how to show the day date and time in Php for the languages suggested. Finally found a way to do this. My wamp server is obviously windows but my web host is Linux. So this goes before the head <?php date_default_timezone_set('Europe/madrid'); setlocale(LC_ALL, array('es.UTF-8','es_ES@euro','es_ES','spanish')); ?> and this goes in the body <?php $spanish= strftime("%A %d %B %Y - %H:%M",time()); echo $spanish; ?> Just change country identifiers for different ones. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.