Uzm Posted January 13, 2008 Share Posted January 13, 2008 I was wondering if there is any way of displaying a readable date in swedish? For example, i have a date: "2007-01-13". That would be Sunday, 13th January 2007, and Söndag, 13 Januari 2007 on swedish. Could anyone describe to me how i can convert dates in this format? Link to comment https://forums.phpfreaks.com/topic/85792-readable-dates-on-swedish/ Share on other sites More sharing options...
twostars Posted January 13, 2008 Share Posted January 13, 2008 <?php function en2sw($date) { $en2sw = array( "January" => "Januari", "Sunday" => "Söndag" ); if (!empty($en2sw[$date])) return $en2sw[$date]; else return $date; } echo en2sw("January"); ?> Usage is pretty self explanatory. Link to comment https://forums.phpfreaks.com/topic/85792-readable-dates-on-swedish/#findComment-437866 Share on other sites More sharing options...
Uzm Posted January 13, 2008 Author Share Posted January 13, 2008 @twostars: Question was to convert for instance "2007-01-13" to "13th January 2007". Link to comment https://forums.phpfreaks.com/topic/85792-readable-dates-on-swedish/#findComment-437871 Share on other sites More sharing options...
twostars Posted January 20, 2008 Share Posted January 20, 2008 @twostars: Question was to convert for instance "2007-01-13" to "13th January 2007". Sorry about the delay. Why not just convert it to the way I had it, and the way you want it, in English first and then use the function on it? Link to comment https://forums.phpfreaks.com/topic/85792-readable-dates-on-swedish/#findComment-444111 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.