Storing dates (was: Re: Ticket Ordering Question)

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 54983
interpreted = N
texte = >...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/ Associated Messages, from the most recent to the oldest:

    
>...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/ Joe D'Andrea

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:

Help name our technology! (1997) Error, 101 a DNS problem ? (1997) Unexpected error (1997) TaxTotal Problem (1997) Showif date > other date (2004) Searching multiple fields (1997) &fieldsdir=ra truely random?? (2000) Fun with Dates - revisited (again) (1997) WebCat2b13MacPlugIn - [include] (1997) Initiating NewCart (1997) Purchased cart being overwritten (1997) Discounts (1998) Reserved Words (2003) [WebDNA] [listfiles] error, but why? How to turn off (2010) Sorting by date (1997) Speed Test Results Dell 2650 Xeon 2.4ghz (2002) [WebDNA] postfix and dna (2011) Bug reported on June 6, 2000 still not fixed ... (2000) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) [WebDNA] v7 Stress Test and Strange Behaviour (2012)