
''' <summary>
''' A set of functions for working with globalized (UTC) date and time values.
''' </summary>
''' <remarks></remarks>
Public Class GlobalDateTime

    ''' <summary>
    ''' Gets the current date and time on this computer, expressed as the Coordinated Universal Time (UTC). 
    ''' </summary>
    ''' <returns>The current date and time on this computer, expressed as the Coordinated Universal Time (UTC).</returns>
    ''' <remarks></remarks>
    Public Shared ReadOnly Property Now As DateTime
        Get
            Return DateTime.UtcNow
        End Get
    End Property

    ''' <summary>
    ''' Converts the specified date and time value to local time.
    ''' </summary>
    ''' <param name="dt">The System.DateTime structure to convert.</param>
    ''' <returns>The specified date and time value as local time.  If the original value is 
    ''' already in local time or is in an unspecified format, the original value is returned.</returns>
    ''' <remarks></remarks>
    Public Shared Function ConvertToLocal(ByVal dt As DateTime) As DateTime
        If (dt.Kind = DateTimeKind.Local) Then _
            Return dt
        Return dt.ToLocalTime()
    End Function

End Class