DateTime.AddMinutes
-
does sombody knows why myDateTime.AddMinutes doesn't do anything? i am trying to do: DateTime myDateTime = Convert.ToDateTime("18/09/2002 13:00"); myDateTime.AddMinutes(40); but nothing happen to this myDateTime?? thanks in advance, sharon
sharon wrote: DateTime myDateTime = Convert.ToDateTime("18/09/2002 13:00"); myDateTime.AddMinutes(40); Try
myDateTime = myDateTime.AddMinutes(40)
The Add... methods only return another DateTime, they don't modify the object. This is pretty much common across the .NET Framework. Paul -
sharon wrote: DateTime myDateTime = Convert.ToDateTime("18/09/2002 13:00"); myDateTime.AddMinutes(40); Try
myDateTime = myDateTime.AddMinutes(40)
The Add... methods only return another DateTime, they don't modify the object. This is pretty much common across the .NET Framework. Paul