Developer forum

Forum » Integration » Log date and time format in Live Integration

Log date and time format in Live Integration

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

In Live Integration, the log format in Logger.cs is defined as follows:

private static readonly string DateTimeFormat = "MM/dd/yyyy hh:mm:ss.fff tt";

That looks OK on most machines but breaks somewhat on cultures like Dutch or German that don't output AM/PM. Consider this code:

string dateTimeFormat = "MM/dd/yyyy hh:mm:ss.fff tt";
var dateInTheNight = new DateTime(2025, 7, 2, 3, 23, 23).ToString(dateTimeFormat, new System.Globalization.CultureInfo("de-DE"));
var dateDayTime = new DateTime(2025, 7, 2, 15, 23, 23).ToString(dateTimeFormat, new System.Globalization.CultureInfo("de-DE"));
@dateInTheNight<br />
@dateDayTime
This outputs the following:
 
07.02.2025 03:23:23.000
07.02.2025 03:23:23.000

Making it impossible to see if the log happend during night time 3 o'clock or day time.
 
Can this be fixed somehow?
 
Imar
 

Replies

 
Rasmus Sanggaard Dynamicweb Employee
Rasmus Sanggaard
Reply
This post has been marked as an answer

Hi Imar,

 

Yes! It makes sense to change it from AM/PM to 24 hrs, in that way supporting the whole world better. Thanks. #24860

 

BR Rasmus Sanggaard

Votes for this answer: 1

 

You must be logged in to post in the forum