Jump to content

echo timestamp value -- help


chemicaluser

Recommended Posts

I have a table in which I am storing a date/time value. It is stored as timestamp. When I try to echo the value, it does not return anything, just a blank field.

this is my code (which works for the rest of my form - with non date values)

 

anyone know why it is not working?

 

$arrival_time = $_GET['arrival_time'];

<tr>
<td align="right" >Arrival Time</td>
<td align="left"><input type="text" id="arrival_time_e" name="arrival_time_e" class="input" value="<?php if (!empty($arrival_time)) echo $arrival_time;?>" /></td>
</tr>

 

i hava also tried ... which returns the value of 1969-12-31 19:00  (but the dates stored in my database are the right timestamp format, 2011-04-26 22:43:11)

<tr>
<td align="right" >Arrival Time </td>
<td align="left"><input type="text" id="arrival_time_e" name="arrival_time_e" class="input" value="<?php echo date("Y-m-d H:i ", strtotime($row['arrival_time']));?>" /> </td>
</tr

 

hope someone can help

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.