$ZDATE ??

41 views
Skip to first unread message

grynien

unread,
Apr 25, 2008, 5:34:49 AM4/25/08
to InterSystems: Zen Community
Hi All,
I have easy question, there is a way to insert and formating date
before 01/01/1841, using $ZDATE??

Robert C. Cemper

unread,
Apr 25, 2008, 5:31:21 PM4/25/08
to InterSys...@googlegroups.com, Marcin.G...@gmail.com
Hi,

12/31/1840 is point zero for $H / $HOROLOG.
Negative values are not allowed.

You have to use Julian date before 12/31/1840
Julian date is $H+2393471

To convert Julian date you have to use $system.SQL.TODATE(...,"J")
Attention:
Values > 2393470 are converted to $H format
Values < 2393471 are converted to SQL date format YYYY-MM-DD
e.g. $system.SQL.TODATE(2374674,"J") ==> 1789-07-14

$system.SQL.TOCHAR(2393430,"J") does the opposite conversion
e.g. $system.SQL.TOCHAR("1776-07-04","J") ==> 2369916

HTH,
Robert C.Cemper
--
Senior Sales Engineer Austria
InterSystems GmbH

robert...@intersystems.at

tel.: +43 (676) 400 80 73
http://www.InterSystems.at/

--
InterSystems GmbH
Hilpertstr. 20a
D-64295 Darmstadt
Tel.: +49.6151.1747-0
Fax: +49.6151.1747-11

Geschäftsführer: Jörg Klingler, John Macheras, Stephen G. Baron
Eingetragen beim AG Darmstadt unter HRB 4966

Reply all
Reply to author
Forward
0 new messages