Add toTime helper

- Update documentation
- Add tests