iso 8601 is good format.
it is accepted by default by sql servers, Log Parser


2016-08-12 0:23 GMT+05:00 Gert Doering <g...@greenie.muc.de>:

> All our timestams used to be "what ctime()" produces, which is
>
>   "Thu Aug 11 21:15:27 2016"
>
> Changed to use POSIX standard format, which is
>
>   "2016-08-11 21:15:27"
>
> this applies to logging (except to syslog or if --machine-readable-ouput
> is used) and to various other places where informational timestamps are
> produced.  Among these are the status files / status to management
> interface, so applications parsing these time stamp need to be adjusted.
>
> trac#719
>
> Signed-off-by: Gert Doering <g...@greenie.muc.de>
> ---
>  src/openvpn/otime.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/openvpn/otime.c b/src/openvpn/otime.c
> index 2c1e5b1..c10a6a8 100644
> --- a/src/openvpn/otime.c
> +++ b/src/openvpn/otime.c
> @@ -112,6 +112,7 @@ time_string (time_t t, int usec, bool show_usec,
> struct gc_arena *gc)
>  {
>    struct buffer out = alloc_buf_gc (64, gc);
>    struct timeval tv;
> +  struct tm *tm;
>
>    if (t)
>      {
> @@ -124,8 +125,10 @@ time_string (time_t t, int usec, bool show_usec,
> struct gc_arena *gc)
>      }
>
>    t = tv.tv_sec;
> -  buf_printf (&out, "%s", ctime(&t));
> -  buf_rmtail (&out, '\n');
> +  tm = localtime(&t);
> +  buf_printf (&out, "%04d-%02d-%02d %02d:%02d:%02d",
> +               tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
> +               tm->tm_hour, tm->tm_min, tm->tm_sec );
>
>    if (show_usec && tv.tv_usec)
>      buf_printf (&out, " us=%d", (int)tv.tv_usec);
> --
> 2.7.3
>
>
> ------------------------------------------------------------
> ------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and
> traffic
> patterns at an interface-level. Reveals which users, apps, and protocols
> are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. http://sdm.link/zohodev2dev
> _______________________________________________
> Openvpn-devel mailing list
> Openvpn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel
>

Reply via email to