Support custom timestamp format, see #6

This is a cleaned up version of PR #6.