diff options
author | Manish Sinha <mail@manishsinha.net> | 2010-10-21 20:48:59 +0530 |
---|---|---|
committer | Manish Sinha <mail@manishsinha.net> | 2010-10-21 20:48:59 +0530 |
commit | 4f6d66b8226db7264f5391c1aeb79268043b3b2a (patch) | |
tree | cc243b568b2740d7c3ca2ec0a323c4794fdabe8b | |
parent | b19edbe17dec0c4adc96946c8ab1b6cf164f8811 (diff) |
Added a ctor for TimeRange which takes the start and end values as DateTime instances
-rw-r--r-- | Zeitgeist/Datamodel/TimeRange.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Zeitgeist/Datamodel/TimeRange.cs b/Zeitgeist/Datamodel/TimeRange.cs index 964678d..954a5bd 100644 --- a/Zeitgeist/Datamodel/TimeRange.cs +++ b/Zeitgeist/Datamodel/TimeRange.cs @@ -11,11 +11,36 @@ namespace Zeitgeist.Datamodel { } + /// <summary> + /// Create a TimeRange instance from the start and end values given as milliseconds since Epoch + /// </summary> + /// <param name="startTime"> + /// The start time. The millseconds since Epoch <see cref="Int64"/> + /// </param> + /// <param name="endTime"> + /// The end time. The millseconds since Epoch <see cref="Int64"/> + /// </param> public TimeRange(Int64 startTime, Int64 endTime) { _begin = ZsUtils.ToDateTime((ulong)startTime); _end = ZsUtils.ToDateTime((ulong)endTime); } + + /// <summary> + /// Create an instance of TimeRange from the values provided as per CLR DateTime instance representation + /// </summary> + /// <param name="startTime"> + /// The start time <see cref="DateTime"/> + /// </param> + /// <param name="endTime"> + /// The end time <see cref="DateTime"/> + /// </param> + public TimeRange(DateTime startTime, DateTime endTime) + { + _begin = startTime; + _end = endTime; + } + /// <summary> /// The begin Timestamp of the event. Seconds elapsed since Epoch /// </summary> |