MyBB Community Forums

Full Version: strftime instead of gmdate
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If MyBB'd use strftime instead of gmdate, the timestamp would be localiceable. So the week and month names would be translateable for the timestamp.
We will probably take this into consideration for MyBB 2.0
There's a solution for this, though with gmdate. Tried it out and works Wink

	// Set up an array with the english named months and weekdays and replace them!
	$replace_array = array (
		"January" => $lang->month_1,
		"February" => $lang->month_2,
		"March" => $lang->month_3,
		"April" => $lang->month_4,
		"May" => $lang->month_5,
		"June" => $lang->month_6,
		"July" => $lang->month_7,
		"August" => $lang->month_8,
		"September" => $lang->month_9,
		"October" => $lang->month_10,
		"November" => $lang->month_11,
		"December" => $lang->month_12,
		"Sunday" => $lang->sunday,
		"Monday" => $lang->monday,
		"Tuesday" => $lang->tuesday,
		"Wednesday" => $lang->wednesday,
		"Thursday" => $lang->thursday,
		"Friday" => $lang->friday,
		"Saturday" => $lang->saturday,
	);
		
	foreach ( $replace_array as $key => $val )
	{
		$date = str_replace ( $key, $val, $date );
	}

The language strings already exists, so all you'd need to do is to add this to the functions.php =)
How can set up local time with gmdate?