コード例 #1
0
        public static DateTime DateTimeBetweenYears(int fromYears, int toYears)
        {
            DateTime now      = System.DateTime.Now;
            DateTime dateTime = now.AddYears(-1 * fromYears);
            DateTime now1     = System.DateTime.Now;

            return(DateTimeFaker.DateTime(dateTime, now1.AddYears(toYears)));
        }
コード例 #2
0
        public static DateTime DateTimeBetweenYears(int years)
        {
            DateTime now      = System.DateTime.Now;
            DateTime dateTime = now.AddYears(-1 * years);
            DateTime now1     = System.DateTime.Now;

            return(DateTimeFaker.DateTime(dateTime, now1.AddDays((double)years)));
        }
コード例 #3
0
        public static DateTime DateTimeBetweenMonths(int months)
        {
            DateTime now      = System.DateTime.Now;
            DateTime dateTime = now.AddMonths(-1 * months);
            DateTime now1     = System.DateTime.Now;

            return(DateTimeFaker.DateTime(dateTime, now1.AddMonths(months)));
        }
コード例 #4
0
        public static DateTime DateTimeBetweenDays(double days)
        {
            DateTime now      = System.DateTime.Now;
            DateTime dateTime = now.AddDays(-1 * days);
            DateTime now1     = System.DateTime.Now;

            return(DateTimeFaker.DateTime(dateTime, now1.AddDays(days)));
        }
コード例 #5
0
 public static DateTime BirthDay(int minAge, int maxAge)
 {
     return(DateTimeFaker.DateTimeBetweenYears(maxAge, minAge));
 }
コード例 #6
0
 public static DateTime DateTime()
 {
     return(DateTimeFaker.DateTimeBetweenDays(5));
 }
コード例 #7
0
 public static DateTime BirthDay()
 {
     return(DateTimeFaker.BirthDay(18));
 }