close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Formatting Dates in Data Assist

Thread began 12/29/2009 9:20 pm by dave216790 | Last modified 7/23/2010 3:29 pm by Jason Byrnes | 1465 views | 7 replies |

dave216790

Formatting Dates in Data Assist

I have a MySQL database that I am using to display a schedule. I have entered all the tables set up and I have them populated with the necessary data. What I am trying to figure out is how make my table display the date field (entered into the database as a date (YYYY-MM-DD)) in the following format DAYOFTHEWEEK, MONTH DD, YYYY.

I'm guessing there is a very simple way to do this. Any help would be appreciated.

Thanks.

Sign in to reply to this post

Office Guy-172461

See if this helps:
199/

Sign in to reply to this post

scott242480

Any other ideas?

The link is dead...any help would be appreciated...thanks!

Sign in to reply to this post

Dani Chankhour

You can try using the php date function as follow:

date('m-d-y',strtotime(value from database));

for more information on the different ways you could display the date, please look at this page:

function.date.php

Sign in to reply to this post

scott242480

m-d-y date format problem

I understand the PHP date() command, the problem is how can I integrate it with the WA code.

I am querying a table using the following:

SELECT id, stamp, call_order, case_number, plantiff, plantiff_attorney, defendant, defendant_attorney, time, duration, location, cancellation FROM trial WHERE stamp >= NOW() And case_number is null ORDER BY stamp ASC, call_order ASC

Stamp is the date field here is WA code that displays it on the page:

<td class="WADAResultsTableCell"><?php echo($row_WADAtrial['stamp']); ?></td>

I tried entering:

date("m-d-y", strtotime($_POST['stamp']));

But that doesn't make any difference...thanks again for any help!

Sign in to reply to this post

Dani Chankhour

What you have is correct, but what is the data type of your date column in your database. In order for that code to work, your column data type in the database needs to be set to 'datetime'.

Sign in to reply to this post

scott242480

MySQL issues

I modified the search query to apply proper date formatting as well as sort in ASC order:

SELECT id, date_format(motion.stamp, '%m/%d/%Y' )as date, call_order, case_number, type, plantiff, plantiff_attorney, defendant, defendant_attorney, location, cancellation
FROM motion
WHERE stamp >= NOW() And case_number is null
ORDER BY stamp ASC, call_order ASC

When I test this query in Dreamweaver, it works perfectly. However when I test it live:

motion_open_dates.php

The dates do not appear! What might be causing this?

Sign in to reply to this post

Jason ByrnesWebAssist

my best guess is that the updated file is not being properly uploaded to the server.


to make sure the changes to the sql are being uploaded to the server, make a visual change tothe page. For example change "Motion Calendar - Open Dates. " to "Motion Calendar - Open Dates. 7/23/2010"

if you do not see the date that you added to the page, then upload is not working correctly.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...