Example #1
0
	$date = ConvertBoxDate($row['EVENT_START_DATE']);
	/*social*/
	$path = 'event-detail.php?MID=' . $MID . '%26CID=' . $row['CAT_ID'] . '%26SID=' . $row['SUB_CAT_ID'] . '%26CONID=' . $row['CONTENT_ID'];
	$fullpath = _FULL_SITE_PATH_ . '/' . $path;
	$redirect_uri = _FULL_SITE_PATH_ . '/callback.php?p=' . $row['CONTENT_ID'];
	$fb_link = 'https://www.facebook.com/dialog/share?app_id=' . _FACEBOOK_ID_ . '&display=popup&href=' . $fullpath . '&redirect_uri=' . $redirect_uri;
	$path = str_replace("%26", "&", $path);

	$title = htmlspecialchars(trim($row['CONTENT_LOC']));
	$detail = strip_tags(trim($row['CONTENT_BRIEF']));
	/*social*/
	$dt = new DateTime($_POST['date']);

	if ($_SESSION['LANG'] == 'TH') {
		$Month = returnThaiMonth($dt -> format("m"));
		$DayOfWeek = returnThaiDayOfWeek($dt -> format("l"));
		$shortMonth = returnThaiShortMonth($dt -> format("m"));
	} else if ($_SESSION['LANG'] == 'EN') {
		$Month = $dt -> format("F");
		$shortMonth = $dt -> format("M");
		$DayOfWeek = $dt ->  format("D");//format("l");
	}


?>
<div class="box-content-slide cf">
	<div class="box-left">
		<div class="box-date cf <?=strtolower($dt -> format("D"))?>">
			<div class="box-left">
				<p>
Example #2
0
function displaydateformatlong($source)
{
    if ($source != '') {
        if ($_SESSION['LANG'] == 'TH') {
            $myDateTime = explode(" ", $source);
            $myDateArray = explode("-", $myDateTime[0]);
            $myYear = sprintf("%d", $myDateArray[0]) + 543;
            $myMonth = returnThaiMonth($myDateArray[1]);
            $myDate = $myDateArray[2];
            return $myDate . ' ' . $myMonth . ' ' . $myYear;
            // . ' ' . $myDateTime[1];
        } else {
            $date = new DateTime($source);
            return $date->format('j F Y');
        }
        // 1 December 2012 13:30
    }
}