/// <summary> /// 距离下架的时间; /// </summary> /// <param name="shopT"></param> /// <returns></returns> public static TimeSpan GetTimeSpanToOffShelve(ShopTemplate shopT) { if (shopT == null) { return(TimeSpan.MaxValue); } return(GameUtils.ConvertStringToDateTime(shopT.getOffShelve()) - ObjectSelf.GetInstance().ServerDateTime); }
/// <summary> /// 根据当前时间判断物品是否在上架; /// </summary> /// <param name="shopT"></param> /// <returns></returns> public static bool IsShopItemInSaling(ShopTemplate shopT) { DateTime dt1 = GameUtils.ConvertStringToDateTime(shopT.getOnShelve()); DateTime dt2 = GameUtils.ConvertStringToDateTime(shopT.getOffShelve()); if (ObjectSelf.GetInstance().ServerDateTime > dt1 && ObjectSelf.GetInstance().ServerDateTime < dt2) { return(true); } return(false); }