PDA

View Full Version : Half hour Time line


r2ks
08-29-2012, 02:29 PM
I am trying to create an half hour time line for a reservation project. The time line should start at 6:00 am |6:30 am | 7:00 am and so on any help on this would be great.
Thanks

jmichae3
09-01-2012, 04:25 AM
in javascript you simply add the number of milliseconds to the Date() object.


//
// Function to correct for 2.x Mac date bug. Call this function to
// fix a date object prior to passing it to SetCookie.
// IMPORTANT: This function should only be called *once* for
// any given date object! See example at the end of this document.
//
function FixCookieDate (date) {
var base = new Date(0);
var skew = base.getTime(); // dawn of (Unix) time - should be 0
if (skew > 0) // Except on the Mac - ahead of its time
date.setTime (date.getTime() - skew);
}


probably something similar for PHP.
yup.

<?php
$date = new DateTime('2000-01-01');
$date->add(new DateInterval('PT10H30S'));
echo $date->format('Y-m-d H:i:s') . "\n";

$date = new DateTime('2000-01-01');
$date->add(new DateInterval('P7Y5M4DT4H3M2S'));
echo $date->format('Y-m-d H:i:s') . "\n";
?>

http://us3.php.net/manual/en/book.datetime.php
http://us3.php.net/manual/en/datetime.construct.php
http://us3.php.net/manual/en/datetime.createfromformat.php
http://us3.php.net/manual/en/datetime.add.php
http://us3.php.net/manual/en/datetime.diff.php

jmichae3
09-01-2012, 04:27 AM
get the .chm enhanced documentation.
php chm manual (http://www.php.net/get/php_manual_en.chm/from/a/mirror)
Why My CHM File is not Displayed Correctly html help error (http://www.helpsmith.com/chm-cannot-be-displayed.php)