4

While choosing PatternLayout if I use %d{%m/%d/%y %H:%M:%S}, it will show the current date and time. The time is according to the UTC format.

My requirement is to display the time accoring to local system time.

Update:

In timehelper.h there is one method Time::localtime will it show the time according to the local system time?

Ankit
  • 1,330
  • 2
  • 11
  • 16

1 Answers1

8

See the PatternLayout class documentation. The detailed description has a table enumerating all the formats. There you should be able to see that UTC is printed by %d and that local time is printed by %D.

Just change the initial %d to %D.

wilx
  • 17,697
  • 6
  • 59
  • 114
  • 1
    Thank you Wilx. I have gone through the PatternLayout class, but possibly I missed that point. It resolved my issue. – Ankit Sep 11 '13 at 04:58