From dfb9ae2371ed4e8a87c2b1e66bfd2109f7ca5ef1 Mon Sep 17 00:00:00 2001 From: Ryan Atkinson Date: Thu, 10 Oct 2019 14:36:51 -0500 Subject: [PATCH] Update readme with decodeTime docs for #65 --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 1c81adf..0dcb302 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,16 @@ You can also input a seed time which will consistently give you the same string ulid(1469918176385) // 01ARYZ6S41TSV4RRFFQ69G5FAV ``` +### Decode Time + +To extract the time component from a ULID, use `decodeTime`. + +```javascript +import { decodeTime } from 'ulid' + +decodeTime('01ARYZ6S41TSV4RRFFQ69G5FAV') // 1469918176385 +``` + ### Monotonic ULIDs To generate monotonically increasing ULIDs, create a monotonic counter.