Specify Date Time Kind Utc - CSharp System

CSharp examples for System:DateTime UTC

Description

Specify Date Time Kind Utc

Demo Code

// Copyright (c) Microsoft Corporation. All rights reserved. 
using System;/*from   w  w  w.j  av a2  s  .  c o  m*/

public class Main{
        public static DateTime SpecifyDateTimeKindUtc(this DateTime dateTime)
        {
            return dateTime.Kind != DateTimeKind.Utc ? DateTime.SpecifyKind(dateTime, DateTimeKind.Utc) : dateTime;
        }
}

Related Tutorials