Dates

4 posts by 3 authors in: Forums > CMS Builder
Last Post: July 12, 2011   (RSS)

By design9 - July 11, 2011

Hello,

I know how to display code to show today's date and work with the date field within an editor but was wondering if there is a way to display the date of a comment that is submitted within my blogs if I do not have a date field in the backend or on the form?[/#000000]

I want to be able to display the date that the user submitted the comment but do not want to include a date field within the form. [/#000000]

Thanks![/#000000]

April[/#000000]

Re: [design9] Dates

By Damon - July 12, 2011

Hi April,

What about passing the current date as a hidden field in the comments form?
Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [design9] Dates

By Jason - July 12, 2011

Hi April,

You can format and display dates stored in the database using the date() and strtotime functions.

For example, if you wanted to display the value of the field createdDate, you could use something like this:

<?php echo date("m-d-Y", strtotime($record['createdDate'])); ?>

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/