Mini Shell

Direktori : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/sp/admin/
Upload File :
Current File : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/sp/admin/function_editdate.php

<?php
function mydatesql($strDate){
    list($Y,$m,$d) = explode("-",$strDate); // แยกข้อความด้วยตัวแบ่ง
    $Y = $Y+543; // จัดรูปแบบปีเป็น ค.ศ. ลบ 543
    $m = sprintf("%'.02d",$m); // จัดรูปแบบเดือน 00
    $d = sprintf("%'.02d",$d); // จัดรูปแบบวัน 00
    $strDate_new = implode("/",array($Y,$m,$d));
    // $strDate_new = "$Y-$m-$d"; // แบบนี้ก็ได้
    return $strDate_new; // ตัวแปรที่ส่งค่ากลับ   
}

?>

Zerion Mini Shell 1.0