@staticmethod<EOL><INDENT>def to_ts(s):<DEDENT>
<EOL>m = Nginx.DATE_FMT.match(s)<EOL>if m:<EOL><INDENT>s = m.group(<NUM_LIT:1>)<EOL>delta = timedelta(seconds=int(m.group(<NUM_LIT:3>)) * (-<NUM_LIT:1> if m.group(<NUM_LIT:2>) == '<STR_LIT:->' else <NUM_LIT:1>)) <EOL><DEDENT>else:<EOL><INDENT>delta = timedelta(seconds=<NUM_LIT:0>)<EOL><DEDENT>dt = datetime.strptime(s, "<STR_LIT>")<EOL>dt += delta<EOL>return dt.strftime('<STR_LIT>')<EOL>
Parses an NGINX timestamp from  "30/Apr/2014:07:32:09 +0000" and returns it as ISO 8601