Now DateTimeOffset - CSharp System

CSharp examples for System:DateTimeOffset

Description

Now DateTimeOffset

Demo Code

// Copyright (C) 2006-2015 Esper Team. All rights reserved.                           /
using System.Text.RegularExpressions;
using System.Globalization;
using System;//  ww  w . j a  v a  2  s. c  om

public class Main{
        public static DateTimeOffset Now(TimeZoneInfo timeZone)
        {
            timeZone = timeZone ?? TimeZoneInfo.Local;
            return TimeZoneInfo.ConvertTime(DateTimeOffset.Now, timeZone);
        }
}

Related Tutorials