viperfx07 is here to blog about hacking, cracking, website, application, android, and many more.

Tuesday, August 24, 2010

Week 4 Practical Exercise

1:35 PM Posted by viperfx07 No comments
Week 4 materials are about server-side technologies, which focus on PHP.

For the exercise, we're gonna use date function on PHP. If you want to see the documentation without going online, just download the documentation here

Don't hesitate to click Read More.

Date function
string date ( string $format [, int $timestamp ] )

Returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given. In other words, timestamp is optional and defaults to the value of time().

Original file week4prac.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

<html xmlns="" xml:lang="en" lang="en">
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

 <title>Week 4 Practical</title>

echo "The date is: ";
echo date("d m Y H:i:s");



The output for the code above: The date is: 24 08 2010 13:29:35

To get 'Monday 15th of August 2005 03:12:46 PM' as the output <-- (not the exact date) Change line 15 to
echo date("l jS \of F Y h:i:s A");

For the question of what sort of online database administration system is provided by my webhost (which is, it is PhpMyAdmin.


Post a Comment