Java dates are stored internally as the number of milliseconds since the
standard base time known as "the epoch" (1 Jan 1970 00:00:00 GMT).  Since
1/1/1970 is day 732 in the multivalue world, the conversion should be
simply: INT(JAVA.DT / 86400000) + 732 - (JAVA.DT < 0)

You could put this in an I-descriptor as follows:

I
INT(JAVA.DATE / 86400000) + 732 - (JAVA.DATE < 0)
D4-
DATE
10R
S


The '- (JAVA.DATE.FIELD < 0)' at the end is necessary to deal with
correcting for the way the INT() function deals with negative numbers.


Larry Hiscock
Western Computer Services
http://www.wcs-corp.com



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Wendy Smoak
Sent: Tuesday, January 27, 2004 3:28 PM
To: U2 Users Discussion List
Subject: Converting between Java/UniData dates



Datatel has stored an internal Java date in a database field.  Would
anyone like to take up the challenge of writing a UniBasic utility to
convert between that and UniData internal date format, and then OCONV
the result?

http://www.pickwiki.com/cgi-bin/wiki.pl?OpenQuestions

They provide a DATE.CONVERT utility that converts between
internal/external format at the colon prompt.  Perhaps a subroutine that
could be used in an I-Descriptor would be useful here, so you can get a
human-readable date from the Java internal date.

--
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management
_______________________________________________
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

_______________________________________________
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to