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.
TImestamp with milliseconds or ten thousandths of a second
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: TImestamp with milliseconds or ten thousandths of a second
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
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