Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

Time Types

CTTIME is declared as a 32-bit unsigned integer, stored as the number of seconds since midnight. It is compatible with FairCom's r-tree and ODBC products. c-tree Plus for .NET provides the class CTTime that exposes the following set of methods to manipulate the CTTIME type:

Method

Operation

Pack()

Pack a time from hour, minute, and second into a CTTIME form.

Unpack()

Unpack a CTTIME time into hour, minute, and second.

TimeToString()

Convert a packed time value into string format.

StringToTime()

Convert a time in string form into a packed time. TimeType() gives the string form of the time value.

Hour()

Retrieve the hour component of a packed time. The hour returned is a 24-hour value. Example 11 pm is returned as 23.

Minute()

Retrieve the minute component of a packed time.

Second()

Retrieve the second component of a packed time.

CurrentTime()

Retrieve the current system time.

String conversion are defined in the TIME_TYPE enum and are shown in the following table.

Time Types can be one of the following string time formats:

c-treeDB
Symbolic Constant

c-treeDB .NET
Symbolic Constant


Description

CTTIME_HMSP

HMSP_TIME

Time is hh:mm:ss am|pm

CTTIME_HMP

HMP_TIME

Time is hh:mm am|pm

CTTIME_HMS

HMS_TIME

Time is hh:mm:ss (24 hour)

CTTIME_HM

HM_TIME

Time is hh:mm (24 hour)

CTTIME_MIL

MIL_TIME

Time is hhmm (military)

CTTIME_HHMST

 

Time is hh:mm:ss.ttt (24 hour)

TOCIndex