Newbie question: how to use UTC time instead of local time?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie question: how to use UTC time instead of local time?

sweinst
Hi,

I'm a new NLog user and I was wondering about the simplest way for using UTC time instead of local time?

Thanks
Serge
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: how to use UTC time instead of local time?

Jarek Kowalski
Administrator
Try ${longdate:universalTime=true}

http://nlog-project.org/wiki/Longdate_layout_renderer
NLog Blog
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: how to use UTC time instead of local time?

sweinst
Thanks, but it doesn't work. I've tried:

${date:universalTime=True:format=yyyy-MM-dd|HH\:mm\:ss.fff}

But I still get the local time. Is it a recent feature? I'm working with 1.0.0.505
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question: how to use UTC time instead of local time?

Jarek Kowalski
Administrator
Yes. You need 2.0 for that.
NLog Blog