tags:

views:

66

answers:

3

Somehow I managed to make the date work,

<td width="67"><font size="3"><b>*Date</b></td>
<td width="3">:</td>
<td width="168"><input name="adate" type="text" id="adate" maxlength="20" value="<?php  echo date("Y/m/d") . "<br />"; ?>">

how do I echo the time in this form:

  <td width="67"><font size="3"><b>*Time</b></td>
    <td width="3">:</td>
    <td width="168"><input name="adtime" type="text" id="adtime" maxlength="15">

    </td>
+2  A: 

simply use the date function but with hour/min/seconds output..

echo date('H:i:s');

Date Function

Marcx
A: 

Depends on what format you want for the time.

the php date() function has a number of different ways of representing time. If you just want HH:MM:SS you could do this:

<td width="168"><input name="adtime" type="text" id="adtime" maxlength="15" value="<?php  echo date("H:i:s") ?>">
Cetra
the current time in here(Philippines)(UTC+08:00) Taipei is 9:04 Am, how do I get that time?Because I'm only seeing: 01:02:42 when I used your code, how about Am or Pm.
+1  A: 

My advice if your programming in PHP go with a framework like CodeIgniter, CakePHP or Zend. Just dont code from scratch out of thin air unless you actually need to.

JeremySpouken