示例#1
0
        public void AppendValue(DateTime value)
        {
            var daysUntil    = value.GetDate().DaysUntil(new Date());
            var minutesUntil = (long)daysUntil * MINUTESINDAY;
            var totalMinutes = ((long)value.GetHours() * MINUTESINHOUR) + (long)value.GetMinutes();

            minutesUntil += totalMinutes;
            mElements.Add(new RecordElement(RecordElementType.DATETIME, minutesUntil.ToString()));
        }
示例#2
0
文件: Helper.cs 项目: cheriephi/diary
 /// <summary>
 /// Returns DateTime identifying properties.
 /// </summary>
 /// <returns>yyyy-MM-dd hh:mm</returns>
 /// <seealso cref="Helper.ToString(Date)"/>
 internal static String ToString(Diary.DateTime dateTime)
 {
     return(String.Format("{0} {1}:{2}", Helper.ToString(dateTime.GetDate()), dateTime.GetHours().ToString("00"), dateTime.GetMinutes().ToString("00")));
 }