logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Schöning <tschoen...@am-soft.de>
Subject Re: Unix Timestamps
Date Thu, 01 Dec 2016 16:34:24 GMT
Guten Tag Felix Endres,
am Donnerstag, 1. Dezember 2016 um 16:37 schrieben Sie:

> is it possible to print a unix timestamp, i.e. seconds since 1970 in the
> PatternLayout (or any other layout)? Optimally I would like a fractional
> pattern showing microseconds.

Is your question about the format or timezone handling? A format
including fractionals is possible and the default already when only
using "%d", but I'm pretty sure it's not supporting microseconds:

> %d{yyyy-MM-dd HH:mm:ss,SSS}
> 2016-12-01 17:20:43,764

Have a look at the classes datepatternconverter, strftimedateconverter
and simpledateformat, which is used depending on your configuration
and might support timezone related stuff. At least there some "Z"
mentioned in simpledatformat, resulting in a calculation of timezone
offsets in "RFC822TimeZoneToken".

Mit freundlichen Grüßen,

Thorsten Schöning

Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

View raw message