public static DateVM ToDateVM(this DateTime date) { var vm = new DateVM { Year = date.Year, Month = date.Month, Day = date.Day, Hour = date.Hour, Seconds = date.Second, Mins = date.Minute }; return(vm); }
public static DateVM ToDateVM(this DateTime?date) { if (date == null) { return(null); } var vm = new DateVM { Year = date.Value.Year, Month = date.Value.Month, Day = date.Value.Day, Hour = date.Value.Hour, Seconds = date.Value.Second, Mins = date.Value.Minute }; return(vm); }
public static DateTime ToDate(this DateVM vm) { var date = new DateTime(vm.Year, vm.Month, vm.Day, vm.Hour, vm.Mins, vm.Seconds); return(date); }
public static DateTime ToUTCDate(this DateVM vm) { var date = new DateTime(vm.Year, vm.Month, vm.Day, vm.Hour, vm.Mins, vm.Seconds); return(DateTime.SpecifyKind(date, DateTimeKind.Utc)); }