TImestamp with milliseconds or ten thousandths of a second

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
JORGEMAL
Posts: 168
Joined: Thu 03 Jul 2008 23:55

TImestamp with milliseconds or ten thousandths of a second

Post by JORGEMAL » Thu 01 Sep 2016 23:21

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.

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: TImestamp with milliseconds or ten thousandths of a second

Post by Pinturiccio » Mon 05 Sep 2016 15:58

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

Post Reply