send date
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simple_Not 2022-10-29 13:48:50 +10:00
parent 07de4fa972
commit be02399eb0

View File

@ -128,10 +128,10 @@ namespace NeDvachAPI
using (var command = new NpgsqlCommand(@" using (var command = new NpgsqlCommand(@"
INSERT INTO dvach " + @"(post_id, post, post_timestamp) 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("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(); int nRows = command.ExecuteNonQuery();
Console.Out.WriteLine("Добавлен пост"); Console.Out.WriteLine("Добавлен пост");