Webmastersite.net
Register Log In

Date field order

Comments on Date field order

hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
Posted Oct 06, 2007 - 7:06 PM:

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
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 08, 2007 - 5:19 PM:

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
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.