Re: [squeazel] Date display format
squeazel, welcome to the CMS Builder forum! :)
The code generator should automatically create a line of code that does this for you like the following:
Date: <?php echo date("D, M jS, Y g:i:s a", strtotime($record['date'])) ?><br/>
The missing step is the strtotime(), just add the code in red:
<?php echo date("t F Y",
strtotime($record['date']
)); ?>
Here's how that works (it's not required to know this but just in case you're curious).
- MySQL stores dates like this: 2008-06-21 20:11:17
- The strtotime() converts it to a 'unix timestamp' like this 1214104277 which is the number of seconds since 1970
- The date() function lets you specify a date format but requires the date as a unix timestamp so it knows exactly which date you mean.
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com