If you want a smaller number and you don't have to really worry about
historical dates, you could shift the date and use 1/1/2000 as day 1 by
subtracting 11688 from the date before you do the multiplication.

Brad Moll
JK Consulting Services, Inc.
Phone:  (763)754-5354
Fax:  (763)463-1750

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steve Johnson
Sent: Tuesday, September 12, 2006 4:31 PM
To: [email protected]
Subject: Re: [U2] Time/Date as a single number

In my application, I add a constant (134408) to the date so that it is
always > 0. Then I right-justify and zero-fill to a constant length both
date (plus constant) and time and delimit them with a literal ":". This
gives me a  non-numeric string with a constant length by which I can sort if
need be.

FWIW, the constant 134408 works with dates back to 1-Jan-1600. (Dates
earlier than year 1583 don't seem to work on UniData.)

Steve Johnson

On 9/12/06, George Gallen <[EMAIL PROTECTED]> wrote:
> OK. what is the ?best? way to store the time/date (to the second) as a 
> single number
>    similar to unix's epoch, although I'm not looking to convert it to 
> unix format.
>
> My method is take date()*86400+time()
> idate=int(combo/86400), itime=combo-(idate*86400)
>
> Is there anyway to do this giving less than 10 characters (and stay in 
> base
> 10) ?
>
> George Gallen
> Senior Programmer/Analyst
> Accounting/Data Division
> [EMAIL PROTECTED]
> ph:856.848.1000 Ext 220
>
> SLACK Incorporated - Delivering the best in health care information 
> and education worldwide.
> http://www.slackinc.com
> -------
> 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/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to