[thelist] Issues working with dates

Todd Richards todd at promisingsites.com
Thu May 7 11:40:08 CDT 2009


Hi Everyone -

I've got a few issues relating to dates on a classic ASP site that I'm
working on, and I'm scratching my head and hoping someone can help.

ISSUE 1:
We are adding the ability for them to enter in some simple press release
announcements to their member site.  The announcements are added, and an
"addedOn" field is populated with the value of "now()".

The plan would be to read a list of the newest announcements for the home
page of the site, but only if they are recent (say withing 14 or 21 days).
For some reason I'm struggling with the best way to do this.  I've messed
around with a dateDiff(), comparing the addedOn date with the current date,
but that doesn't seem to be working.

- Is it possible to do it the way I'm thinking (using the dateDiff with the
AddedOn field?  Should I be using a value "date()" rather than "now()" when
entering the records, if I'm looking to compare the values?
- Should I add another field in there for them to set a date to keep it
"featured"?

ISSUE 2:
I'm listing upcoming events on an events page.  I'm trying to do simple
"order by endDate" (in format of mm-dd-yyyy).  I thought it was working but
last night I changed a date and now it's broke.  It seems that it's ordering
by the "mm" part.  So if I have two dates, "05-11-2009" and "11-10-2009",
they are in the correct order.  But if I have  two events with dates of
"04-05-2022" and "10-22-2009", the one in 2022 comes first.

Thanks for any thoughts.  It seems that I always struggle when working with
dates. 

Todd






More information about the thelist mailing list