rscott7706 Posted June 2, 2006 Share Posted June 2, 2006 In the code below. can Date Record Entered: [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$ts[!--colorc--][/span][!--/colorc--] be date formatted?//get data - eg, reading fields 0 and 1$id=$myrow[0];$cpny=$myrow[3];$cont=$myrow[1];$ti=$myrow[2];$ph=$myrow[4];$em=$myrow[5];$opn=$myrow[6];$desc=$myrow[7];$req=$myrow[8];$mn=$myrow[9];$mx=$myrow[10];$nd=$myrow[11];$ts=$myrow[12];print "</tr>\n<tr>\n";// output row from databaseecho "<td>Date Record Entered: $ts<br><br>Opening ID#: $id <br>Company: $cpny <br> Contact: $cont <br> Title: $ti <br> Phone: $ph <br>E-mail: <a href=mailto:$em>$em </a> <br>Opening: $opn <br> Description: $desc <br> Requirements: $req <br>Min $: $mn <br>Max $: $mx <br>Need Date: $nd <br> Quote Link to comment https://forums.phpfreaks.com/topic/11000-date-format/ Share on other sites More sharing options...
AndyB Posted June 2, 2006 Share Posted June 2, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]... can Date Record Entered: $ts be date formatted?[/quote]Yes - assuming it exists in the database in a known, constant, rational format, i.e. not at the whim of whoever entered a 'date'.There's a ton of alternatives for date formatting, detailed near the top of the page in the manual - [a href=\"http://ca.php.net/manual/en/function.date.php\" target=\"_blank\"]http://ca.php.net/manual/en/function.date.php[/a] Quote Link to comment https://forums.phpfreaks.com/topic/11000-date-format/#findComment-41079 Share on other sites More sharing options...
rscott7706 Posted June 2, 2006 Author Share Posted June 2, 2006 Here is my feeble attept. maybe someone can help this real newbie...This (or other variations crash. If i just use the formatting text, it just shows as text in the resulting page.Date Record Entered: ($ts = date("F j, Y, g:i a")<br><br> Quote Link to comment https://forums.phpfreaks.com/topic/11000-date-format/#findComment-41080 Share on other sites More sharing options...
AndyB Posted June 2, 2006 Share Posted June 2, 2006 Assuming the format in the database is fixed, what is it? Quote Link to comment https://forums.phpfreaks.com/topic/11000-date-format/#findComment-41081 Share on other sites More sharing options...
poirot Posted June 2, 2006 Share Posted June 2, 2006 Try to change:[code]($ts = date("F j, Y, g:i a")[/code]to[code] (" . date("F j, Y, g:i a", $ts) . ")[/code] Quote Link to comment https://forums.phpfreaks.com/topic/11000-date-format/#findComment-41084 Share on other sites More sharing options...
rscott7706 Posted June 2, 2006 Author Share Posted June 2, 2006 Andy, it's timestamppoirot, it worked great!! Thanks my friend.... Quote Link to comment https://forums.phpfreaks.com/topic/11000-date-format/#findComment-41088 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.