Page 1 of 1

TImestamp with milliseconds or ten thousandths of a second

Posted: Thu 01 Sep 2016 23:21
by JORGEMAL
I am using PostgreSQL and dotConnect for PostgreSQL to develop an application in .NET where I use a timestamp field. Actually, I am inserting records with the format ToString("yyyy/MM/dd HH:mm:ss"). Is it possible to specify milliseconds or ten thousandths of a second?

According to Microsoft documentation (https://msdn.microsoft.com/en-us/librar ... .110).aspx) I am trying ToString("yyyy/MM/dd HH:mm:ss.fff") for milliseconds and ToString("yyyy/MM/dd HH:mm:ss.ffff") for ten thousandths of a second but I get an error saying that syntax is not valid. However, the format ToString("yyyy/MM/dd HH:mm:ss") works pefectly well.

Regards.

Re: TImestamp with milliseconds or ten thousandths of a second

Posted: Mon 05 Sep 2016 15:58
by Pinturiccio
Please provide a snippet of code where you create a command with the command text, parameter value, and ToString("yyyy/MM/dd HH:mm:ss") code.

You can use a DateTime or PgSqlTimestamp value for the parameter instead of a string. For more information, please refer to https://www.devart.com/dotconnect/postg ... Stamp.html