Goo'day, George,
At 17:31 12/09/06 -0400, you wrote:
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.
Would you achieve anything by setting a base at, say, 1st October, 2006 and
simply using your 10 years of seconds (about 316,000,000) or even more, as
an add-on to that? That gives about 30 years.....
That way you've got 9 digits or less, and no packing/unpacking, etc...
For example, 1st October is day 14154, a seconds count of 12345657 = 205760
minutes = 3429 hours = 142 days which gives day 14295 = 19th Feb,
2007. A seconds count of 987654321 (9 digits) = 16460905 minutes =
274348 hours = 11431 days = day 25584 = 16th Jan 2038...... More than your
required 10 years worth....????
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/
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.1.406 / Virus Database: 268.12.3/446 - Release Date: 12/09/06
Regards,
Bruce Nichol
Talon Computer Services
ALBURY NSW 2640
Australia
http://www.taloncs.com.au
Tel: +61 (0)411149636
Fax: +61 (0)260232119
If it ain't broke, fix it till it is!
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.406 / Virus Database: 268.12.3/446 - Release Date: 12/09/06
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/