Date format help

QuestionsDate format help
Shumaila Khan asked 5 years ago

I am trying to format date – timestamp.

http://mobilemotos.com/sendgrid_lgs/phpgrid/

<?php
/**
* PHP Grid Component
*
* @author Abu Ghufran <[email protected]> – http://www.phpgrid.org
* @version 1.5.2
* @license: see license.txt included in package
*/
// include db config
include_once("../../config.php");

// set up DB
mysql_connect(PHPGRID_DBHOST, PHPGRID_DBUSER, PHPGRID_DBPASS);
mysql_select_db(PHPGRID_DBNAME);

// include and create object
include(PHPGRID_LIBPATH."inc/jqgrid_dist.php");

$g = new jqgrid();

$opt["caption"] = "Info";
$g->set_options($opt);
// set table for CRUD operations

$g->table = "info";
$g->set_actions(array(
"showhidecolumns"=>true, // allow/disallow delete
"rowactions"=>true, // show/hide row wise edit/del/save option
"autofilter" => true, // show/hide autofilter for search
)
);
// render grid
$out = $g->render("my_grid_1");

$themes = array("black-tie","blitzer","cupertino","dark-hive","dot-luv","eggplant","excite-bike","flick","hot-sneaks","humanity","le-frog","mint-choc","overcast","pepper-grinder","redmond","smoothness","south-street","start","sunny","swanky-purse","trontastic","ui-darkness","ui-lightness","vader");
$i = rand(0,8);

// if set from page
if (is_numeric($_GET["themeid"]))
$i = $_GET["themeid"];
else
$i = 15;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
<html>
<head>
<title>Sendgrid Logs</title>
<link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/themes/<?php echo $themes[$i]?>/jquery-ui.custom.css"></link>
<link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/jqgrid/css/ui.jqgrid.css"></link>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js&quot; type="text/javascript"></script>
<script src="../../lib/js/jqgrid/js/grid.locale-en.js" type="text/javascript"></script>
<script src="../../lib/js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="../../lib/js/jqgrid/js/jquery-ui-custom.min.js" type="text/javascript"></script>
</head>
<body>
<div style="margin:10px">
<p>
<form method="get">
<!– Choose Theme: <select name="themeid" onchange="form.submit()">
<?php foreach($themes as $k=>$t) { ?>
<option value=<?php echo $k?> <?php echo ($i==$k)?"selected":""?>><?php echo ucwords($t)?></option>
<?php } ?>
</select>
–>

</form>
</p>
<?php echo $out?>
</div>
</body>
</html>

2 Answers
Abu Ghufran answered 5 years ago

If your database field datatype is date or datetime or timestamp, then you can refer demos/integration/datepicker.php from package for formatting example and datepicker integration.

Abu Ghufran answered 5 years ago

The link seems to have real email address data, so it is not recommended to share on forum.
Question is hidden now.

Your Answer

3 + 15 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?