PHP Classes

File: examples-static.php

Recommend this page to a friend!
  Classes of Sallar Kaboli   Jalali (Shamsi) DateTime Class   examples-static.php   Download  
File: examples-static.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Jalali (Shamsi) DateTime Class
Convert and format dates in the Jalali calendar
Author: By
Last change:
Date: 12 years ago
Size: 624 bytes
 

Contents

Class file image Download
<?php

//Include
require_once dirname(__FILE__) . '/jdatetime.class.php';

//Just adding routine html tags and setting encoding to view Persian characters correctly.
echo "<html>";
echo
"<head>";
echo
"<meta charset='utf-8'>";
echo
"</head>";
echo
"<body>";

date_default_timezone_set('Asia/Tehran');

echo
jDateTime::date('l j F Y H:i');
echo
"<br />";
echo
jDateTime::date('Y-m-d', false, false);
echo
"<br />";
echo
jDateTime::date('Y-m-d', false, false, false);
echo
"<br />";
echo
jDateTime::date("l j F Y H:i T", false, null, null, 'America/New_York');

//Just adding routine html tags.
echo "</body>";
echo
"</html>";