Date in new framework

I am lost with the new date. The code that is commented out
//Dim D As New Xojo.Core.Date(2015, 9, 1, 15, 20, 30, 0, Xojo.Core.TimeZone.Current)
works, but when I replace hard typed integers with actual integers, I get a syntax error with the following code.
Dim D As New Xojo.Core.Date(yy, mo, dd, hh, mi, , 0, 0, Xojo.Core.TimeZone.Current)

Any ideas?

[code]//161001_0300 The incoming format is yymmdd_hhmm

Using Xojo.Core

Dim yy as Int64
Dim mo as Int64
Dim dd as Int64
Dim hh as Int64
Dim mi as Int64

yy = CLong(left(t,2)) + 2000

if mid(t,3,1) = “0” then
mo = CLong(mid(t,4,1))
else
mo = CLong(mid(t,3,2))
end if

if mid(t,5,1) = “0” then
dd = CLong(mid(t,6,1))
else
dd = CLong(mid(t,5,2))
end if

if mid(t,8,1) = “0” then
hh = CLong(mid(t,9,1))
else
hh = CLong(mid(t,8,2))
end if

if mid(t,10,1) = “0” then
mi = CLong(mid(t,11,1))
else
mi = CLong(mid(t,10,2))
end if

Dim D As New Xojo.Core.Date(yy, mo, dd, hh, mi, , 0, 0, Xojo.Core.TimeZone.Current)
//Dim D As New Xojo.Core.Date(2015, 9, 1, 15, 20, 30, 0, Xojo.Core.TimeZone.Current)

Return D

[/code]

There is a comma without a parameter: "mi, , " . You probably stared at the code too long.

Also the code is pretty weird:

if mid(t,3,1) = "0" then mo = CLong(mid(t,4,1)) else mo = CLong(mid(t,3,2)) end if

What do you think this does? Replace this with:

 mo = CLong(mid(t,3,2))

Maybe in this way is easier:
//161001_0300 The incoming format is yymmdd_hhmm
//if it is a string then convert it to Text (using .ToText)
//now you have t as text =“161001_0300”

dim txtDate as text=“20”+t.Left(2)+"-"+t.Mid(2,2)+"-"+t.Mid(4,2)+" “+t.Mid(7,2)+”:"+t.Right(2)+":00"
dim d as Xojo.Core.Date=Xojo.Core.Date.fromText(txtDate)

//d is in your current timeZone

Unbelievable. I look at the code for a couple hours, and even re-typed it.

Antonio - thanks for the much simpler approach!