Navigation

 ·   Wiki Home
 ·   Wiki Help
 ·   Categories
 ·   Title List
 ·   Uncategorized Pages
 ·   Random Page
 ·   File Upload
 ·   Uploaded Files
 ·   Recent Changes
 ·   RSS
 ·   Atom
 ·   What Links Here

Active Members:

Search:

 

Create or Find Page:

 

View Date Formatting For Queries

Category:HowTo
Question: How can I format the date fields in my query?

Answer: For more information on doing this, see the EEWiki entry.

{exp:query sql="SELECT
   FROM_UNIXTIME(`entry_date`,'%m/%d/%y') AS `entry_date`
   FROM `exp_weblog_titles`"

NOTE: Starting with EE 1.4.x you can now use format= inside the results of your query.

Example:

{exp:query sql="SELECT page_name, last_updated from exp_wiki_page
order by last_updated desc limit 1"
}
{page_name} 
{last_updated format="%m-%d-%Y"}<br />
{/exp:query}