I'm limited to 10 characters, and to a barcode that will only use 0-9. Problem is one of the 10 characters will need to be a basic checksum, which drops me to 9 numbers. (this can't change it's the way the bar code reader/decoder is setup).
I figured 86400, from 60 sec * 60 min * 24 hours I could cheat a little, since none of the dates would be before Oct 2006. But it doesn't leave me much room. I really don't know what the upper date limit will be (I'd like to be able to work with 10 years at a min.) which is 3660 * 86400 = 31622400, which works. I think I have it worked out, but it's messy using all kinds of bit manipulation and packing, hoping it's not too slow. George > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Kevin King > Sent: Tuesday, September 12, 2006 4:45 PM > To: [email protected] > Subject: RE: [U2] Time/Date as a single number > > > >My method is take date()*86400+time() > > Is the goal to track a chronology via a single field? If so, I'd say > your calulation is close. Wouldn't it be: > > ((DATE() - 1) * 86500) + TIME() > > (...as the number of days elapsed is today - 1, not today.) > > Regardless, you're right that the date could get humongous. For the > cycles you're going through to do this calculation it would be a small > step to convert it into and out of any other base to compress and > decompress the bytes. > > The foundational question, however, is one of context. Why do you > need this? That answer may limit or expand your options. > > -Kevin > [EMAIL PROTECTED] > http://www.PrecisOnline.com > > ** Check out scheduled Connect! training courses at > http://www.PrecisOnline.com/train.html. > ------- > u2-users mailing list > [email protected] > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
