Jump to content

litebearer

Members
  • Posts

    2,356
  • Joined

  • Last visited

Everything posted by litebearer

  1. Simply have a field in your database where you store the variable $timestamp (keep in mind that mysql timestamps and Unix timestamps are different - my advice is to just have the field as and integer). when you are ready to display the article and date simply retrieve it and use the [code] echo "The date is : " . date('l dS \of F Y h:i:s A', $timestamp);[/code] to display the date Lite...
  2. That's the problem with getting old, we seem to slow down. Anyway here is a quick, rough couple of snippets to assist you. spec.php [code] <html> <head> </head> <body bgcolor="#ffffff" text="#003399" link="#0000ff" vlink="#800080" alink="#ff0000"> <form action="spec02.php" method="post"> <!-- DATETIME Drop Menu --> <!-- MONTH --> <select name="month" ><? for($i=1;$i<13;$i++){ echo "<option value='".($i)."'>$i</option>"; } ?></select> <!-- DAY --> <select name="day"><? for($i=1;$i<32;$i++) echo "<option value='$i'>$i</option>"; ?></select>, <!-- YEAR --> <select name="year"><? echo date('Y'); $currYear=date("Y"); for($i=$currYear-6;$i<$currYear+5;$i++) echo "<option value='$i'>$i</option>"; ?></select> <!-- HOUR --> <select name="hour"><? for($i=1;$i<25;$i++) echo "<option value='$i'>$i</option>"; ?></select>: <!-- MINUTES --> <select name="minute"><? for($i=0;$i<60;$i++) echo "<option value='$i'>$i</option>"; ?></select>: <!-- SECONDS --> <select name="second"><? for($i=0;$i<60;$i++) echo "<option value='$i'>$i</option>"; ?></select> <input type="submit" value="submit"> </form> </body> </html>[/code] spec02.php [code]<?PHP $month = $_POST['month']; $day = $_POST['day']; $year = $_POST['year']; $hour = $_POST['hour']; $minute = $_POST['minute']; $second = $_POST['second']; echo "Month = " . $month . "<br>"; echo "Day     = " . $day . "<br>"; echo "Year = " . $year . "<br>"; echo "Hour = " . $hour . "<br>"; echo "Minute = " . $minute . "<br>"; echo "Second = " . $second . "<br>"; $artdate = $year . "-" . $month . "-" . $day . "- " .  $hour . ":" . $minute . ":" . $second; $timestamp = strtotime($artdate); echo "Unix time stamp = " . $timestamp . "<br>"; echo "The date is : " . date('l dS \of F Y h:i:s A', $timestamp); ?>[/code] in action - [a href=\"http://www.nstoia.com/spec.php\" target=\"_blank\"]http://www.nstoia.com/spec.php[/a] Hope it is of some help. Lite...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.