Jump to content

Archived

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

rscott7706

Date Format

Recommended Posts

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 database
echo "<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>

Share this post


Link to post
Share on other sites
[!--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]

Share this post


Link to post
Share on other sites
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>

Share this post


Link to post
Share on other sites
Assuming the format in the database is fixed, what is it?

Share this post


Link to post
Share on other sites
Try to change:
[code]($ts = date("F j, Y, g:i a")[/code]
to
[code] (" . date("F j, Y, g:i a", $ts) . ")[/code]

Share this post


Link to post
Share on other sites
Andy, it's timestamp


poirot, it worked great!! Thanks my friend....

Share this post


Link to post
Share on other sites

×

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.