June 08, 2016 Best way to convert Apachelog Datetime 01/Jan/2016:02:25:10 -> 2016-01-01 02:25:10 MySQL-Datetime Format | ||||
---|---|---|---|---|
| ||||
I know there are easy ways to handle this, anyone with a code snippet for me? I would use two regex first to make 01,02,03... from Jan,Feb,.. and second to split the result. best regards mt. |
June 08, 2016 Re: Best way to convert Apachelog Datetime 01/Jan/2016:02:25:10 -> 2016-01-01 02:25:10 MySQL-Datetime Format | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Tschierschke | On Wednesday, 8 June 2016 at 10:42:19 UTC, Martin Tschierschke wrote: > I know there are easy ways to handle this, > anyone with a code snippet for me? I found this solution, letting the MySQL engine do the work: SELECT STR_TO_DATE('26/Apr/2011:13:21:58', '%d/%b/%Y:%H:%i:%S'); https://www.experts-exchange.com/questions/26992776/convert-apache-log-date-time-to-mysql.html Maybe there is an other short solution using the std.datetime and or https://code.dlang.org/packages/dateparser ? |
Copyright © 1999-2021 by the D Language Foundation