DateTime.ToUniversalTime() : DateTime « System « VB.Net by API






DateTime.ToUniversalTime()

  

public class Test
   public Shared Sub Main
        Dim D As DateTime
        D = Now()
    
        Console.WriteLine(D.ToUniversalTime().GetType().Name)
    
        Console.WriteLine("UTC-LocalTime=" + D.ToUniversalTime().Subtract(D).ToString())
    
        Console.WriteLine("Ticks since 12:00AM January 1, 1 CE="+ Now().Ticks().ToString())
   End Sub
End class

   
    
  








Related examples in the same category

1.New DateTime
2.DateTime.DayOfWeek
3.DateTime.IsLeapYear
4.DateTime.Second
5.DateTime.Subtract
6.DateTime.UtcNow()
7.DateTime.Year