From be02399eb0b2308b9829c80562e9885f65bdd9d0 Mon Sep 17 00:00:00 2001 From: Simple_Not <44047940+moonbaseDelta@users.noreply.github.com> Date: Sat, 29 Oct 2022 13:48:50 +1000 Subject: [PATCH] send date --- DBchat.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DBchat.cs b/DBchat.cs index 11273d7..81aa10d 100644 --- a/DBchat.cs +++ b/DBchat.cs @@ -128,10 +128,10 @@ namespace NeDvachAPI using (var command = new NpgsqlCommand(@" INSERT INTO dvach " + @"(post_id, post, post_timestamp) - VALUES (DEFAULT, @postText, @postTimeStamp)", conn)) + VALUES (DEFAULT, @postText, (SELECT date_trunc('second', now()::timestamp(0)) AT TIME ZONE 'UTC-10') )", conn)) { command.Parameters.AddWithValue("postText", postToSend.Text); - command.Parameters.AddWithValue("postTimeStamp", DateTime.Now.ToString("dd/MM/yyyy HH:mm")); + //command.Parameters.AddWithValue("postTimeStamp", DateTime.Now.ToString("dd/MM/yyyy HH:mm")); int nRows = command.ExecuteNonQuery(); Console.Out.WriteLine("Добавлен пост");