Получить серверное время

    public class ServerTime : IExternalScript
    {
        public void Execute(IContext ctx, ISecurity sec)
        {
            var time = GetServerTime(sec);
            ctx.Log($"Server time: {time?.ToString()}", MessageType.Info, true);
        }

        private DateTime? GetServerTime(ISecurity sec)
        {
            var con = sec.SecurityDescription.TradePlace.DataSource as IConnectable;
            return con?.ServerTime;
        }
    }

Last updated