Re: Dates!

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 19237
interpreted = N
texte = The best way to store dates is as the number of days since 00/00/0000, which you can get by [math]{[date]}[/math]. It's *much* quicker than mm/dd/yyyy when searching and sorting. In your listings, you can convert the numbers back into dates using [Format Days_to_Date].To search for events occuring today, just set up your search criteria to look for events whose start date is today or earlier and whose end date is today or later, like so: [Search db=events.db&leStart_datedatarq=[math]{[Date]}[/math]&geEnd_datedatarq=[math]{[D ate]}[/math]&Start_datetype=num&End_datetype=num]You just have to make sure that one-day events have both a Start_date and an End_date (the same, obviously) or your searches won't work as expected.-DaveAt 1:06 PM 7/31/98, Mícheál O Sé wrote: >Hi folks, >I need some advice on the best way to enter dates into a database. I have a >customer who wants to set up an event guide with each event having a >start_date and End_date. He wants users to be able to click for events on >{Today} so WebCat needs to compare {today's date} with the start_date >/End_date range. Is mm/dd/yyy the best way to store these dates in the .db? >What is the best way to search the .db for {todays} events? >Any advice much appreciated:-) > >Regards, >**************************************************************** >Micheal O Se >www.elive.ie Internet Hosting Service >micheal@elive.ie Database powered websites >**************************************************************** o--------------- Dave MacLeay --+ o----------- Digital Frontier --+ o--- dave@digitalfrontier.com --+ Associated Messages, from the most recent to the oldest:

    
  1. RE: Dates! (Pat McCormick 1998)
  2. Re: Dates! (Kenneth Grome 1998)
  3. Dates! (Mícheál O Sé 1998)
  4. Re: Dates! (Dave MacLeay 1998)
The best way to store dates is as the number of days since 00/00/0000, which you can get by [math]{[date]}[/math]. It's *much* quicker than mm/dd/yyyy when searching and sorting. In your listings, you can convert the numbers back into dates using [Format Days_to_Date].To search for events occuring today, just set up your search criteria to look for events whose start date is today or earlier and whose end date is today or later, like so: [Search db=events.db&leStart_datedatarq=[math]{[date]}[/math]&geEnd_datedatarq=[math]{[D ate]}[/math]&Start_datetype=num&End_datetype=num]You just have to make sure that one-day events have both a Start_date and an End_date (the same, obviously) or your searches won't work as expected.-DaveAt 1:06 PM 7/31/98, Mícheál O Sé wrote: >Hi folks, >I need some advice on the best way to enter dates into a database. I have a >customer who wants to set up an event guide with each event having a >start_date and End_date. He wants users to be able to click for events on >{Today} so WebCat needs to compare {today's date} with the start_date >/End_date range. Is mm/dd/yyy the best way to store these dates in the .db? >What is the best way to search the .db for {todays} events? >Any advice much appreciated:-) > >Regards, >**************************************************************** >Micheal O Se >www.elive.ie Internet Hosting Service >micheal@elive.ie Database powered websites >**************************************************************** o--------------- Dave MacLeay --+ o----------- Digital Frontier --+ o--- dave@digitalfrontier.com --+ Dave MacLeay

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Web Catalog Instability (2000) Field name-subcategory (1997) Strange conversions (2001) Locking up with WebCatalog... (1997) Mac OS X Server, Apache etc etc (1999) Exists? (1997) CSS in HTML emails? (2003) ImageMagick Commands? (2003) I give up!! (1997) WebCat2 - storing unformatted date data? (1997) WebDNA 5.x & iTools 7 & Apache 2 (2003) WC Database Format (1997) Smith Micro - no competition - Feedback (2000) 2 easy questions re: [showif] and [sendmail] (1997) Database Security (1998) [shownext] link disappears after first use. Why? (2000) Emailer (WebCat2) (1997) [OT] Colored source code in IE? (2007) Command=Showcart? (2000) required fields (1998)