WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

Date field order

Version: 4.0.39
printPrint


Date field order
hai
Forum Regular
Avatar

Usergroup: Customer
Joined: Apr 03, 2007
Total Topics: 41
Total Posts: 169
Posted 10/06/07 - 04:06 PM:
quote post
#1
I am using wsnlinks as a database for concerts using dates for the titles. Previously, I was using an excel spreadsheet and therefore was able to format a date field to show as mm/dd/yyyy. When I converted to using wsnlinks I changed the format of the date to yyyy/mm/dd to force them to sort correctly. Is there any way to change it so that I can go back to the old mm/dd/yyyy format and still have them sort correctly?

If this is something that would require customization (if it can even be done), and therefore a charge from you, can you give me an idea of that cost?
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5929
Posted 10/08/07 - 02:19 PM:
quote post
#2
You store them as the mysql date datatype?

You can use this PHP to display in a new format:
<?php $timestamp = strtotime("{LINKYOURFIELD}"); echo strftime("%X", $timestamp); ?>

-- setting your format with the options at http://www.php.net/strftime

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.