# Custom time parser

**URL:** <https://forum.crystal-lang.org/t/custom-time-parser/7409>\
**Category:** Help & Support\
**Created:** [November 13, 2024, 10:28pm UTC](https://forum.crystal-lang.org/t/custom-time-parser/7409 "2024-11-13T22:28:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgaskins](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/jgaskins/32/2449_2.png) [@jgaskins](https://forum.crystal-lang.org/u/jgaskins)\
**Post date:** [November 13, 2024, 10:28pm UTC](https://forum.crystal-lang.org/t/custom-time-parser/7409/1 "2024-11-13T22:28:57Z")

</div>

I need to implement a custom `Time::Format` parser. Is [`Time.parse`](https://crystal-lang.org/api/1.14.0/Time.html#parse%28time%3AString%2Cpattern%3AString%2Clocation%3ALocation%29%3ATime-class-method) the best way to do that or is there a first-class, documented way to do that similarly to `Time::Format::*`?

`Time::Format::Parser` is [explicitly undocumented](https://github.com/crystal-lang/crystal/blob/dacd97bccc80b41c7d6c448cfad19d37184766e9/src/time/format/parser.cr#L2-L3).

---

<div class="post-metadata">

**Author:** ![straight-shoota](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/straight-shoota/32/36_2.png) [@straight-shoota](https://forum.crystal-lang.org/u/straight-shoota)\
**Post date:** [November 13, 2024, 10:44pm UTC](https://forum.crystal-lang.org/t/custom-time-parser/7409/2 "2024-11-13T22:44:36Z")

</div>

I’m not sure why `Time::Format::Parser` is undocumented. Maybe to avoid compatibility concerns with so many tiny API methods? I believe it has been refactored quite a bit in the past.  
Although it has been pretty stable lately and I wouldn’t expect much reason for it to change.  
So I’d probably just use it. Worst case if the stdlib code changes, you can always put the current parser into your codebase and use that.
