You can write conditional code for the .NET environment, taking advantage of features that are not available directly in the PowerBuilder Classic application environment.
#if defined PBDOTNET then
System.DateTime dt_instance
System.DateTime current_datetime
dt_instance = create System.DateTime
current_datetime = dt_instance.Now
#end if
#if defined PBDOTNET then
System.DateTime current_datetime
current_datetime = System.DateTime.Now
#end if
my_obj.TestMethod(ref l_string)