fixed timezone in xray logs

This commit is contained in:
fgsfds 2025-11-08 13:34:17 +05:00
parent 575ee854c8
commit 6b44526acb
No known key found for this signature in database
GPG key ID: 264C1B9113012917
2 changed files with 5 additions and 3 deletions

View file

@ -844,9 +844,11 @@
text = `<td>${log.Email}</td>`;
}
const { locale, timeZone } = Intl.DateTimeFormat().resolvedOptions();
formattedLogs += `
<tr ${outboundColor}>
<td><b>${new Date(log.DateTime).toLocaleString()}</b></td>
<td><b>${new Date(log.DateTime).toLocaleString(locale, { timeZone })}</b></td>
<td>${log.FromAddress}</td>
<td>${log.ToAddress}</td>
<td>${log.Inbound}</td>

View file

@ -794,11 +794,11 @@ func (s *ServerService) GetXrayLogs(
for i, part := range parts {
if i == 0 {
dateTime, err := time.Parse("2006/01/02 15:04:05.999999", parts[0]+" "+parts[1])
dateTime, err := time.ParseInLocation("2006/01/02 15:04:05.999999", parts[0]+" "+parts[1], time.Local)
if err != nil {
continue
}
entry.DateTime = dateTime
entry.DateTime = dateTime.UTC()
}
if part == "from" {