profesorfalken / jProcesses

Get crossplatform processes details with Java
Apache License 2.0
63 stars 26 forks source link

Support Norwegian locale dateformat from ps, as well as custom format #17

Closed janhoy closed 8 years ago

janhoy commented 8 years ago

Got ParseException when running your tool on my Mac with Norwegian locale. The parser for unix date from ps was hardcoded to English. This PR adds Norwegian-style format as an alternative (month day switch places) and tries several combinations before throwing ParseException. Also catch ParseException and fallback to 01/01/2000 00:00:00 if still cannot be parsed. New method on ProcessUtils setCustomDateFormat() to support unknown formats.

Bump Java version from 1.5 to 1.6 since "noone" using 1.5 anymore and some of your original code requires 1.6 anyways.

profesorfalken commented 8 years ago

Hello, I have reviewed it and it seems OK to me.

JProcesses was intended originally for an environment where only 1.5 version was available and I had no control on it. After that, another github user contributed with code that used 1.6 and I had asked him to remove it but maybe something was left.

Anyway, OK to update to 1.6. I will have to do it some day...

Thanks for your contribution!!

janhoy commented 8 years ago

Thanks :)