Jump to content

Date Format


rscott7706

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>
Link to comment
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]
Link to comment
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>
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.