There would be better ways to write it, though for now, correction/changes to what you wrote that would work:
public class compiler
shared function Main as integer
Dim dtsnow As date
Dim currentDate, startDate As String
Dim dd, mm, yy As String
dtsnow = Now()
dd = Right("00" & Day(dtsnow), 2)
mm = Right("00" & Month(dtsnow), 2)
yy = Year(dtsnow)
currentDate = yy + mm + dd
startDate = yy + mm + "01"
Console.WriteLine ("currentDate:"+currentDate)
Console.WriteLine ("startDate:"+startDate)
return 0
End function
end class