Browse Source

added 'make'

Nicolas Cannasse 18 years ago
parent
commit
366654d5ed
1 changed files with 7 additions and 0 deletions
  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)));
+	}
+
 }