Hi,
the problems with Date are really strange
what kind of beast is Date in Jabaco? and
what kind of beast is Date in Java (resp. java#util#Date)?
the problem is that java#util#Date seams not to fit in java#util#Date.
sounds like a strange bug? yes it does ...
look at this:
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
Public Sub Form_Load()
Dim Cal As New java#util#GregorianCalendar
Dim jd As java#util#Date
Dim dt As Date
'jd = Cal.getTime 'Uuurgh
'Auto conversion 'Date' to 'java/util/date' is not supported!
'OK then let's do it this way and convert it afterwards... (?)
dt = Cal.getTime
MsgBox dt
jd = CJUDate(dt)
'but when giving to a function the next problem:
'MsgBox Foo(jd) 'Uuurgh
'Auto conversion 'Date' to 'java/util/date' is not supported!
End Sub
Private Function Foo(d As java#util#Date) As String
Foo = d.toGMTString
End Function
Private Function CJUDate(d As Date) As java#util#Date
CJUDate = New java#util#Date
Dim y As Integer = Year(d)
CJUDate.setYear(y - 1900)
CJUDate.setMonth(Month(d))
CJUDate.setDate(Day(d))
CJUDate.setHours(Hour(d))
CJUDate.setMinutes(Minute(d))
CJUDate.setSeconds(Second(d))
End Function
|
greetings
OlimilO