TS Class
A quantity specifying a point on the axis of natural time.

Inheritance Hierarchy

OnlineSystem Object
  MARC.Everest.DataTypes HXIT
    MARC.Everest.DataTypes ANY
      MARC.Everest.DataTypes PDV <OnlineString >
        MARC.Everest.DataTypes QTY <OnlineString >
          MARC.Everest.DataTypes TS

Namespace: MARC.Everest.DataTypes
Assembly: MARC.Everest.Phone (in MARC.Everest.Phone.dll) Version: 1.5.0.0 (1.5.0)

Syntax

C#

public class TS : QTY<string>, IPointInTime, 
	IPrimitiveDataValue<DateTime>, IPrimitiveDataValue, IAny, IImplementsNullFlavor, 
	ISemanticEquatable, IGraphable, IEquatable<TS>, IComparable<TS>, 
	IPqTranslatable<TS>, IDistanceable<TS>, IImplicitInterval<TS>, 
	IOrderedDataType<TS>

Remarks

A point in time is most often represented as a calendar expression.

The TS class also supports arithmetic date operations with other TS as well as PQ.

Examples

TS flavors

 // TS Sample, Time Zone is EDT
TS test = DateTime.Parse("March 1, 2009 12:00:00 AM");
 Console.WriteLine(test.ToString()); // output : 20090301000000.000-0500  
 test.Flavor = "DATETIME";
 Console.WriteLine(test.ToString()); // output : 20090301000000-0500
 test.Flavor = "DATE";
 Console.WriteLine(test.ToString()); // output : 20090301
 test.DateValuePrecision = DatePrecision.Year;
 Console.WriteLine(test.ToString()); // output : 2009

Date Arithmetic

// Two dates
TS now = DateTime.Now, 
    endOfWorld = DateTime.Parse("12-21-2012");

// Difference between dates
Console.WriteLine("{0} until {1}",  endOfWorld - now, endOfWorld);
// Sample Output: 44.30293848594 Ms until 20121221000000.000-0500 
// Adding time to a date
Console.WriteLine("1 week from now: {0}", now + new PQ(1, "wk"));
// Sample Output: 1 week from now: 20110801153525.358-0500

Version Information

Everest Compact Framework

Supported in: 1.2 Compact

Everest Framework

Supported in: 1.2, 1.0

See Also