chemicaluser Posted September 18, 2011 Share Posted September 18, 2011 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 More sharing options...
creata.physics Posted September 18, 2011 Share Posted September 18, 2011 Have you tried to echo only the timestamp itself? echo $row['arrival_time']; If you have not, can you do that and tell me what it prints? Link to comment https://forums.phpfreaks.com/topic/247394-echo-timestamp-value-help/#findComment-1270500 Share on other sites More sharing options...
chemicaluser Posted September 18, 2011 Author Share Posted September 18, 2011 it does not display anything, just a blank field. Link to comment https://forums.phpfreaks.com/topic/247394-echo-timestamp-value-help/#findComment-1270505 Share on other sites More sharing options...
Psycho Posted September 18, 2011 Share Posted September 18, 2011 Then that value is not getting passed to the page. What is the full URL that is displayed in the browser when you access this page? Link to comment https://forums.phpfreaks.com/topic/247394-echo-timestamp-value-help/#findComment-1270512 Share on other sites More sharing options...
chemicaluser Posted September 19, 2011 Author Share Posted September 19, 2011 thanks, lol it works now Link to comment https://forums.phpfreaks.com/topic/247394-echo-timestamp-value-help/#findComment-1270519 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.