I am searching a program zo convert $horo into a "readable" date (ie.
dd.mm.jjjj, jjjjmmdd, ...) and backwards.
Anybody out there, who can help me?!?
Thanks, Ralf
mailto ralf....@mosecker.de
In Cache' you may simply use $ZD() and $ZDT() functions.
Dmitri Martynov
Seems - but after a few tests it could reveal that it does find too
many leap years...
Oh, I must be wrong - it uses the variable % - that's system programming!
Can't be wrong! >%->
SHD has a (documented) routine that works; with freely configureable
output formats and about 8 input formats including things like day of
year, month, _correct_ week of year , automatic completion of any valid
input format etc.
Unfortunately I'm not with SHD any more and have no access to it...
But maybe they'll give it away, if you ask someone there. :-)
--
Jürgen
--------------------------------------------------
"You'd have to be a born fool to be a king." (Granny Weatherwax)
I have discovered that the code above has a bug. Please examine the test
that I did on my system at work:
>W $ZV
Open M [ISM] for OpenVMS V7.x (Alpha) 6.4-F.14 (build-03) 20-JUL-1998
12:32:39.66
>
>F I=1:1:57925 S X=$$DTS^LMVDT(I),Y=$$UPPER^%ZLIBSTR($$D^%D(I)) I
X'=Y W !,X,?20,Y,?40,I
31 DEC 1844 00 JAN 1845 1461
31 DEC 1848 00 JAN 1849 2922
31 DEC 1852 00 JAN 1853 4383
31 DEC 1856 00 JAN 1857 5844
31 DEC 1860 00 JAN 1861 7305
31 DEC 1864 00 JAN 1865 8766
31 DEC 1868 00 JAN 1869 10227
31 DEC 1872 00 JAN 1873 11688
31 DEC 1876 00 JAN 1877 13149
31 DEC 1880 00 JAN 1881 14610
31 DEC 1884 00 JAN 1885 16071
31 DEC 1888 00 JAN 1889 17532
31 DEC 1892 00 JAN 1893 18993
31 DEC 1896 00 JAN 1897 20454
31 DEC 1900 00 JAN 1901 21914
31 DEC 1904 00 JAN 1905 23375
31 DEC 1908 00 JAN 1909 24836
31 DEC 1912 00 JAN 1913 26297
31 DEC 1916 00 JAN 1917 27758
31 DEC 1920 00 JAN 1921 29219
31 DEC 1924 00 JAN 1925 30680
31 DEC 1928 00 JAN 1929 32141
31 DEC 1932 00 JAN 1933 33602
31 DEC 1936 00 JAN 1937 35063
31 DEC 1940 00 JAN 1941 36524
31 DEC 1944 00 JAN 1945 37985
31 DEC 1948 00 JAN 1949 39446
31 DEC 1952 00 JAN 1953 40907
31 DEC 1956 00 JAN 1957 42368
31 DEC 1960 00 JAN 1961 43829
31 DEC 1964 00 JAN 1965 45290
31 DEC 1968 00 JAN 1969 46751
31 DEC 1972 00 JAN 1973 48212
31 DEC 1976 00 JAN 1977 49673
31 DEC 1980 00 JAN 1981 51134
31 DEC 1984 00 JAN 1985 52595
31 DEC 1988 00 JAN 1989 54056
31 DEC 1992 00 JAN 1993 55517
31 DEC 1996 00 JAN 1997 56978
>
The first column is from a date program we use on the system that I made
a quick modification to so that the date would output in the same format
as %D. The second column is the output from %D. The third column is the
$H date that the two programs used.
---------------------------------
"Friends help you move. Real friends help you move bodies."
Leane Verhulst
Spam Block: Replace nospam with nmff
Quite right, adding S:'D D=1461,Y=Y-4 after the D=D#1461 will fix it.
Ray Newman
BTW If anyone wants a comprehensive date formatter, I have one I am
prepared to post.
>S %H=$P($H,","),2) S X=$ZD(%H,2) or
S %H=$P($H,",") S X=$&ZLIB.%CDATASC(%H,2) for a 2 digit year or
S %H=$P($H,",") S X=$&ZLIB.%CDATASC(%H,3) for a 4 digit year.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
> Hello, Ralf!
> Ralf Huwald wrote in message <7oc4qb$iij$1...@news01.btx.dtag.de>...
> >I am searching a program zo convert $horo into a "readable" date (ie.
> >dd.mm.jjjj, jjjjmmdd, ...) and backwards.
> >Anybody out there, who can help me?!?
>
> In Cache' you may simply use $ZD() and $ZDT() functions.
> Dmitri Martynov
Be very, VERY careful using $ZD & $ZDT; the results of these functions can
change depending on the settings of system switches. I don't use other
people's functions if I can't guarantee the results...
--
======================================================================
Kate Schell csc...@JacquardSystems.com
Jacquard Systems Research phone & fax: 301-762-8999
800 Nelson Street http://www.JacquardSystems.com
Rockville, MD 20850-2051
Old code never dies.
It just hangs around waiting for the millennium.
======================================================================
Since by definition $Z functions are non Standard that would depend on
the specific implementation you're running on.
--
-- Rod --
ro...@polylogics.com
In Cache', set the 4th parameter of $ZD() or the 6th parameter of $ZDT()
(yearopt) to 4.
Dmitri A. Martynov,
Makova AG (http://www.makova.com)
--
Valentin Kamburov
Project/Analyst Engineer
TranSoft a.s.
Ceske Budejovice,Czech Republi