Exemplo n.º 1
0
        /// <summary>
        /// Sets the offset such that right now is the specified now.
        /// </summary>
        public static void SetNowLocal(DateTime nowLocal)
        {
            switch (Now.Mode)
            {
            case NowMode.Absolute:
                Now.AbsoluteNow = nowLocal;
                break;

            case NowMode.Offset:
                Now.Offset = Now.ComputeOffset(nowLocal);
                break;

            default:
                throw new Exception(EnumHelper.UnexpectedEnumerationValueMessage(Now.Mode));
            }
        }
Exemplo n.º 2
0
        public static void SetNowUTC(DateTime nowUTC)
        {
            var nowLocal = nowUTC.ToLocalTime();

            Now.SetNowLocal(nowLocal);
        }