views:

30

answers:

1

Since it's possible using the IsNumeric() and others VB.NET functions from IronPython by importing Microsoft.VisualBasic and using it as an object method, is it possible somehow to use the Year() VB.NET function from IronPython?

+1  A: 

The full name for the method is Microsoft.VisualBasic.DateAndTime.Year(DateTime). This is a compat function. Since you need to pass a DateTime argument anyway, you might as well use its Year property.

Albeit that the VB version can be different because it uses the current culture calendar's GetYear() method. In other words, in Israel your program might get the year since the destruction of the temple in Jerusalem (I think). Not sure if that should be intentional in your case.

Hans Passant