# ReadTimeTags()

Reads the date and time values logged in a binary file. This method stores the date values in a dateTags array, and the time values in a timeTags array.

Member of the DataLogger class.

## Function Prototype

VB .NET

Public Function ReadTimeTags(ByVal startSample As Integer, ByVal count Integer, ByRef dateTags As Integer, ByRef timeTags As Integer) As MccDaq.ErrorInfo

C# .NET

public MccDaq.ErrorInfo ReadTimeTags(int startSample, int count, ref int [] dateTags, ref int [] timeTags)

## Parameter

startSample

The first sample to read from the binary file.

count

The number of samples to read from the binary file.

dateTags

Receives the date tag values. Dates are packed in the following format:

Byte 0: day
Byte 1: month
Byte 2 - 3: year

timeTags

Receives the time tag values. Times are packed in the following format:

Byte 0: seconds
Byte 1: minutes
Byte 2: hours
Byte 3: 0xff = 24hour format, 0x0 = AM, 0x1 = PM

## Returns

- An ErrorInfo object that indicates the status of the operation.
- dateTags – Returns the date value for each sample logged in the file.
- timeTags – Returns the time value for each sample logged in the file.

## Notes

- Time stamped data is stored according to the timeZone preference and the timeFormat preference. Refer to SetPreferences().
- Time stamped data is logged in the file if InstaCal is configured to do so. If time stamps are not logged, the time array is filled with values calculated from the file header information.

### Date and Time array size

The user is responsible for allocating the size of the date and time arrays, and ensuring that they are large enough to hold the data that is returned. You can calculate the array allocation using the sampleCount value from GetSampleInfo().

int* dates = new int[sampleCount];
int* times = new int[sampleCount];

dateTags array

The figure below shows the layout of the dateTags array, and how the elements should be indexed.

where n is (numberOfSamples – 1)

Each sample has only one date. Use the following code fragment to access the elements of the dateTags array:

for (i=0; i<numberOfSamples; i++)

{

d = dateTagsArray[i];

}

timeTags array

The figure below shows the layout of the timeTags array, and how the elements should be indexed.

where n is (numberOfSamples – 1)

Each sample has only one time stamp. Use the following code fragment to access the elements of the timeTags array:

for (i=0; i<numberOfSamples; i++)

{

t = timeTagsArray[i];

}