private bool tryDateTimeImpl(
string name,
ushort fid,
ref DateTime result,
bool throwOnError)
{
EnsurePeerCreated();
ulong dateTimeMsec = 0;
int code = NativeMethods.mamaMsg_getDateTimeMSec(nativeHandle, name, fid, ref dateTimeMsec);
if ((MamaStatus.mamaStatus)code != MamaStatus.mamaStatus.MAMA_STATUS_OK)
{
if (throwOnError)
{
CheckResultCode(code);
}
else
{
return false;
}
}
long ret = ((long)dateTimeMsec * TimeSpan.TicksPerMillisecond) + 621355968000000000;
result = new DateTime(ret);
return true;
}