Browse Source

added 'make'

Nicolas Cannasse 18 năm trước cách đây
mục cha
commit
366654d5ed
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      std/DateTools.hx

+ 7 - 0
std/DateTools.hx

@@ -196,4 +196,11 @@ class DateTools {
 		};
 	}
 
+	/**
+		Build a date-time from several components
+	**/
+	public static function make( o : { ms : Float, seconds : Int, minutes : Int, hours : Int, days : Int } ) {
+		return o.ms + 1000.0 * (o.seconds + 60.0 * (o.minutes + 60.0 * (o.hours + 24.0 * o.days)));
+	}
+
 }