# GetTimeStampForMsg Method - neoVI API

This method calculates the timestamp for a message, based on the connected hardware type, and converts it to a usable variable.

{% tabs %}
{% tab title="C/C++ Declare" %}

```cpp
int _stdcall icsneoGetTimeStampForMsg(void * hObject, icsSpyMessage *pMsg, icsSpyMessage *pMsg, double *pTimeStamp);
```

{% endtab %}

{% tab title="Visual Basic .NET Declare" %}

```vbnet
Public Declare Function icsneoGetTimeStampForMsg Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pMsg As icsSpyMessage, ByRef pTimeStamp As Double) As Int32
```

{% endtab %}

{% tab title="C# Declare" %}

```csharp
[DllImport(“icsneo40.dll”)] public static extern IntPtr icsneoGetTimeStampForMsg(Int32 hObject, ref icsSpyMessage pMsg, ref double pTimeStamp);
```

{% endtab %}
{% endtabs %}

**Parameters**

hObject

\[in] Specifies the driver object created by [OpenNeoDevice](/neovi-api/win32-api-overview-intrepidcs-api/basic-functions-overview-intrepidcs-api/openneodevice-method-intrepidcs-api.md).

pMsg

\[in] The message to be used for calculating timestamp.

pTimeStamp

\[out] The calculated timestamp.

**Return Values**

Returns 1 if successful, 0 if an error occurred. [GetLastAPIError](/neovi-api/win32-api-overview-intrepidcs-api/error-functions-overview-intrepidcs-api/getlastapierror-method-intrepidcs-api.md) must be called to obtain the specific error. The errors that can be generated by this function are:

NEOVI\_ERROR\_DLL\_NEOVI\_NO\_RESPONSE = 75

**Remarks**

Different models of neoVI devices have different time resolutions. This function uses the proper formula to calculate a timestamp based on the connected device type.

### Examples

{% tabs %}
{% tab title="C/C++ Example" %}

```cpp
int hObject;
int iResult;
double dTimeStamp;
icsSpyMessage Msg;

iResult = icsneoGetTimeStampForMsg(m_hObject, &Msg, &dTimeStamp);
```

{% endtab %}

{% tab title="Visual Basic .NET Example" %}

```vbnet
Dim iResult As Integer
Dim dTimeStamp As Double
icsSpyMessage Msg;

iResult = icsneoGetTimeStampForMsg(m_hObject, Msg, dTimeStamp)
```

{% endtab %}

{% tab title="C# Example" %}

```csharp
int iResult;
long lTimeStamp;
icsSpyMessage Msg;

iResult = icsNeoDll.icsneoGetTimeStampForMsg(m_hObject, ref Msg, ref dTimeStamp);
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.intrepidcs.com/neovi-api/win32-api-overview-intrepidcs-api/message-functions-overview-intrepidcs-api/gettimestampformsg-method-intrepidcs-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
