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
https://forums.phpfreaks.com/topic/247394-echo-timestamp-value-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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