Re: Storing dates (was: Re: Ticket Ordering Question)

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 54984
interpreted = N
texte = Joe, I have to agree with you... I am coding a date-related thing right now and I was wondering what was wrong with storing dates as [date] (MM/DD/YYY) like I've always done, which works fine for me as long as I specify &THE_DATE_FIELDtype=date in my search or whatever when I need to sort/display.... Just my $0.02 -Dan ------------------------------------------------------------ http://www.StrongGraphicDesign.com http://www.SearchBoise.com (208) 319-0137 | Toll-free p/f 877-561-1656 ------------------------------------------------------------ On Mon, 15 Dec 2003 14:04:59 -0500 Joe D'Andrea wrote: >>...Also, it hasn't been brought up lately on the list, so I'll mention that most experienced >>DNA'ers store their dates and times as numerical values (e.g. store the [math]{[date]}[/math] >>value instead of the [date] value) in their databases whenever they can. This makes searches, >>sorts and comparisons much easier and faster, and you can format the value for display in any way >>you wish using the [format days_to_date ...] context. > >Uhhh... Yeah I bought into that conspiracy a couple of years ago too. "store dates as integer" > Today, I say baloney. Once you understand how WebDNA handles dates, searching for a date or >doing date math is just as easy using mm/dd/yyy notation. I suspect the whole idea of "store >dates as integers" came about because WebDNA's date math was not understood. There may have even >been a bug in WebDNA that forced people to use integers instead of dates. I'm sure that's no >longer the case. > >When I was converting dates to integers, I was always getting caught trying to figure out what >the integer value of a certain date was if I ever had to examine the database manually, or update >a field using a generic database editor. I also find it easier when it's time to export a raw >database to have the dates stored as human readable dates. > >Sure, storing dates as integers saves a couple of octets on your hard drive, and you probably >save a few CPU cycles when you do integer math instead of date math. But that's why we have fast >CPUs and large disk drives. > >YMMV.. this is not a rant... just my opinion. > >~Joe > >-- >_______________________________________________________________ > Joseph D'Andrea ~ http://www.west21.com/ ~ JoeDan@West21.com > WEST21.com Internet services for the 21st Century >webhosting ~ co-location ~ wireless access ~ WebCat programming > >------------------------------------------------------------- >This message is sent to you because you are subscribed to > the mailing list . >To unsubscribe, E-mail to: >To switch to the DIGEST mode, E-mail to >Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
Joe, I have to agree with you... I am coding a date-related thing right now and I was wondering what was wrong with storing dates as [date] (MM/DD/YYY) like I've always done, which works fine for me as long as I specify &THE_DATE_FIELDtype=date in my search or whatever when I need to sort/display.... Just my $0.02 -Dan ------------------------------------------------------------ http://www.StrongGraphicDesign.com http://www.SearchBoise.com (208) 319-0137 | Toll-free p/f 877-561-1656 ------------------------------------------------------------ On Mon, 15 Dec 2003 14:04:59 -0500 Joe D'Andrea wrote: >>...Also, it hasn't been brought up lately on the list, so I'll mention that most experienced >>DNA'ers store their dates and times as numerical values (e.g. store the [math]{[date]}[/math] >>value instead of the [date] value) in their databases whenever they can. This makes searches, >>sorts and comparisons much easier and faster, and you can format the value for display in any way >>you wish using the [format days_to_date ...] context. > >Uhhh... Yeah I bought into that conspiracy a couple of years ago too. "store dates as integer" > Today, I say baloney. Once you understand how WebDNA handles dates, searching for a date or >doing date math is just as easy using mm/dd/yyy notation. I suspect the whole idea of "store >dates as integers" came about because WebDNA's date math was not understood. There may have even >been a bug in WebDNA that forced people to use integers instead of dates. I'm sure that's no >longer the case. > >When I was converting dates to integers, I was always getting caught trying to figure out what >the integer value of a certain date was if I ever had to examine the database manually, or update >a field using a generic database editor. I also find it easier when it's time to export a raw >database to have the dates stored as human readable dates. > >Sure, storing dates as integers saves a couple of octets on your hard drive, and you probably >save a few CPU cycles when you do integer math instead of date math. But that's why we have fast >CPUs and large disk drives. > >YMMV.. this is not a rant... just my opinion. > >~Joe > >-- >_______________________________________________________________ > Joseph D'Andrea ~ http://www.west21.com/ ~ JoeDan@West21.com > WEST21.com Internet services for the 21st Century >webhosting ~ co-location ~ wireless access ~ WebCat programming > >------------------------------------------------------------- >This message is sent to you because you are subscribed to > the mailing list . >To unsubscribe, E-mail to: >To switch to the DIGEST mode, E-mail to >Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ "Dan Strong"

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:

Counting LineItems (2000) primer/tutorial question (2004) DON'T use old cart file! (1997) Server Traffic Simulation (1998) Multiple prices (1997) UPDATE PROBLEM (1997) Document Contains No Data! (1997) Download URL & access on the fly ? (1997) WebCatalog-NT?'s (1996) Re:Emailer and encryption (1997) Setting up shop (1997) [LOOKUP] (1997) Re:mail list (1998) Car Database (2002) Where is f2? (1997) Appending space (1998) $Quit, $CloseDatabase corrections (1997) What file? (1997) Date Math (1999) Progress Bar (2004)