Files
mtusi2026lab5/src/Messenger.Api/Data/UtcClock.cs
T

12 lines
318 B
C#

namespace Messenger.Api.Data;
public static class UtcClock
{
// PostgreSQL timestamptz stores microseconds; keep the response identical to the saved value.
public static DateTime Now()
{
var ticks = DateTime.UtcNow.Ticks;
return new DateTime(ticks - ticks % 10, DateTimeKind.Utc);
}
}