logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 08-29-2012, 02:29 PM   #1
r2ks
 
Join Date: Jan 2010
Posts: 6
Default Half hour Time line

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
r2ks is offline   Reply With Quote
Old 09-01-2012, 04:25 AM   #2
jmichae3
 
Join Date: Dec 2010
Posts: 366
Default

in javascript you simply add the number of milliseconds to the Date() object.

Code:
//
//  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.
Code:
 <?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/datetim...fromformat.php
http://us3.php.net/manual/en/datetime.add.php
http://us3.php.net/manual/en/datetime.diff.php


__________________
------------
Jim Michaels
HTML Code:
improperly<strong>nested<em>elements</strong>cause</em>
browser confusion (I believe the term is 'tag soup')!
jmichae3 is offline   Reply With Quote
Old 09-01-2012, 04:27 AM   #3
jmichae3
 
Join Date: Dec 2010
Posts: 366
Default

get the .chm enhanced documentation.
php chm manual
Why My CHM File is not Displayed Correctly html help error
__________________
------------
Jim Michaels
HTML Code:
improperly<strong>nested<em>elements</strong>cause</em>
browser confusion (I believe the term is 'tag soup')!
jmichae3 is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:15 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com