Exemplo n.º 1
0
        public static string DateDiff(DateTime history)
        {
            DateTime today = DateTime.Now;

            if (history == null)
            {
                return(ZLanguageManager.GetPopupwin("Time.Standard", today.Year, today.Month, today.Day, today.Hour, today.Minute));
            }

            TimeSpan span = DateDiff(today, history);

            if (span.Days > 60)
            {
                return(ZLanguageManager.GetPopupwin("Time.Standard", history.Year, history.Month, history.Day, history.Hour, history.Minute));
            }
            else if (span.Days > 30)
            {
                return(ZLanguageManager.GetPopupwin("Time.Diff.Month", 1));
            }
            else if (span.Days > 0)
            {
                return(ZLanguageManager.GetPopupwin("Time.Diff.Day", span.Days));
            }
            else if (span.Hours > 0)
            {
                return(ZLanguageManager.GetPopupwin("Time.Diff.Hour", span.Hours));
            }
            else if (span.Minutes > 10)
            {
                return(ZLanguageManager.GetPopupwin("Time.Diff.Minute", span.Minutes));
            }
            else
            {
                return(ZLanguageManager.GetPopupwin("Time.Diff.Latest"));
            }
        }
Exemplo n.º 2
0
        public static string GetDate()
        {
            DateTime time = DateTime.Now;

            return(ZLanguageManager.GetPopupwin("Date.Year.Month", time.Year, time.Month));
        }