Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Time Layout Renderer

Rolf Kristensen edited this page Oct 19, 2024 · 11 revisions

The time in a 24-hour, sortable format HH:mm:ss.mmmm.

Platforms Supported: All

See also ${processtime}, ${date}, ${longdate}, ${shortdate}

Configuration Syntax

${time:universalTime=Boolean:invariant=Boolean}

Parameters

Rendering Options

  • universalTime - Indicates whether to output UTC time instead of local time. Boolean Default: False
  • invariant - Indicates whether to output in invariant time format, and not lookup of current cultureinfo. Boolean Default: true (Before NLog 5.0 the default was false)

    Introduced with NLog 4.5.2

  • culture - Culture used for time format. Default: InvariantCulture

    Introduced with NLog 5.0

Time Source Precision

NLog uses local-time by default, but because conversion from machine-time to local-time has an overhead, then NLog uses cached time-source FastLocal with 15ms time-precision that follows Environment.TickCount. For high time-precision and still fast performance, then consider using Time-source AccurateUtc (Time-precision of 1ms)

Clone this wiki locally