Files
lecturer/includes/functions.php
T
2012-06-13 09:18:40 +07:00

78 lines
1.5 KiB
PHP
Executable File

<?php
DEFINE("EMAIL", "&#119;&#105;&#108;&#108;&#121;&#115;&#114;&#64;&#116;&#105;.&#117;&#107;&#100;&#119;.&#97;&#99;.&#105;&#100;");
function showDate()
{
date_default_timezone_set("Asia/Jakarta");
$tgl=date("d");
if (substr($tgl,0,1)==0)
{
$tgl=substr($tgl,-1);
}
$bulan=date("F");
$tahun=date("Y");
echo "<strong>" . $tgl . " " . $bulan . " " . $tahun . "</strong>";
}
function showLastUpdate($filename)
{
if (file_exists($filename))
{
date_default_timezone_set('Asia/Jakarta');
$tanggal = date("d", filemtime($filename));
if (substr($tanggal,0,1)==0)
{
$tanggal=substr($tanggal,-1);
}
$bulan = date("m", filemtime($filename));
switch ($bulan)
{
case 1 : $bulan_id="January"; break;
case 2 : $bulan_id="February"; break;
case 3 : $bulan_id="March"; break;
case 4 : $bulan_id="April"; break;
case 5 : $bulan_id="May"; break;
case 6 : $bulan_id="June"; break;
case 7 : $bulan_id="July"; break;
case 8 : $bulan_id="August"; break;
case 9 : $bulan_id="September"; break;
case 10 : $bulan_id="Oktober"; break;
case 11 : $bulan_id="November"; break;
case 12 : $bulan_id="December"; break;
}
$tahun = date("Y", filemtime($filename));
$jam = date("H:i:s", filemtime($filename));
echo "Last Update : " . $tanggal . " " . $bulan_id . " " . $tahun . " :: " . $jam . "\n";
}
}
?>