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:

purchase.log file (1997) Pipes instead of tabs (1998) Getting total number of items ordered (1997) searchable list archive (1997) Summing fields (1997) Test (2001) 2nd WebCatalog2 Feature Request (1996) OT: one to one live chat (1999) more info on [setlineitems] (1997) Cold Fusion Buster (1997) Unable to view next 101-200 (1997) Online reference (1997) RE: PCS search results page (1998) [WebDNA] jumping on the linux train (2011) Uniqueness of Cart number (2000) plugin-acgi, different results (1997) Dummy Credit Card Number for debug? (1997) ReturnRaw and redirect one last question (1997) Frames and WebCat (1997) [OT] Who's got a cool link (2002)