Re: log_filename_prefix --> log_filename + strftime() - Mailing list pgsql-patches

From Tom Lane
Subject Re: log_filename_prefix --> log_filename + strftime()
Date
Msg-id 23223.1095723599@sss.pgh.pa.us
Whole thread Raw
In response to Re: log_filename_prefix --> log_filename + strftime()  ("Ed L." <pgsql@bluepolka.net>)
Responses Re: log_filename_prefix --> log_filename + strftime()  ("Ed L." <pgsql@bluepolka.net>)
List pgsql-patches
"Ed L." <pgsql@bluepolka.net> writes:
> +     /*
> +      * We expect a strftime(%z) result of the form "[+-]HHMM" according to
> +      * RFC822-conformant dates, where HH:MM is the unsigned UTC offset.
> +      * If we don't get it, just return zero offset, and let the logs
> +      * rotate on UTC time boundaries.
> +      */
> +
> +     count = strftime(msg, 6, "%z", localtime(&now));

That might work for you, but it's not portable.

            regards, tom lane

pgsql-patches by date:

Previous
From: "Ed L."
Date:
Subject: Re: log_filename_prefix --> log_filename + strftime()
Next
From: "Ed L."
Date:
Subject: Re: log_filename_prefix --> log_filename + strftime()