time-teller
v1.0.0
Published
Convert dates into human-readable 'time ago' or 'time until' strings
Maintainers
Readme
��
�
�#� ��# �t�i�m�e�-�t�e�l�l�e�r�
�
�
�
�>� �C�o�n�v�e�r�t� �d�a�t�e�s� �i�n�t�o� �h�u�m�a�n�-�r�e�a�d�a�b�l�e� �s�t�r�i�n�g�s� �l�i�k�e� ��� 2� �h�o�u�r�s� �a�g�o� �� �o�r� ��� i�n� �3� �d�a�y�s� ��.�
�
�
�
�-�-�-�
�
�
�
�#�#� �=� �I�n�s�t�a�l�l�a�t�i�o�n�
�
�
�
����b�a�s�h�
�
�n�p�m� �i�n�s�t�a�l�l� �t�i�m�e�-�t�e�l�l�e�r�
�
����
�
�
�
�-�-�-�
�
�
�
�#�#� �=��� �U�s�a�g�e�
�
�
�
����j�s�
�
�c�o�n�s�t� �{� �t�i�m�e�A�g�o�,� �t�i�m�e�U�n�t�i�l� �}� �=� �r�e�q�u�i�r�e�(�"�t�i�m�e�-�t�e�l�l�e�r�"�)�;�
�
�
�
�/�/� �P�a�s�t� �t�i�m�e�s�
�
�c�o�n�s�o�l�e�.�l�o�g�(�t�i�m�e�A�g�o�(�"�2�0�2�5�-�0�8�-�0�1�"�)�)�;� �
�
�/�/� ��! �"�1� �m�o�n�t�h� �a�g�o�"�
�
�
�
�/�/� �F�u�t�u�r�e� �t�i�m�e�s�
�
�c�o�n�s�o�l�e�.�l�o�g�(�t�i�m�e�U�n�t�i�l�(�"�2�0�2�5�-�1�2�-�2�5�"�)�)�;� �
�
�/�/� ��! �"�i�n� �3� �m�o�n�t�h�s�"�
�
����
�
�
�
�-�-�-�
�
�
�
�#�#� �=��� �A�P�I�
�
�
�
�#�#�#� ��t�i�m�e�A�g�o�(�d�a�t�e�)��
�
�
�
�� �C�o�n�v�e�r�t�s� �a� ��D�a�t�e��,� �t�i�m�e�s�t�a�m�p�,� �o�r� �d�a�t�e� �s�t�r�i�n�g� �i�n�t�o� �a� �h�u�m�a�n�-�f�r�i�e�n�d�l�y� � t�i�m�e� �a�g�o� �f�o�r�m�a�t�.�
�
�� �R�e�t�u�r�n�s� ��"�j�u�s�t� �n�o�w�"�� �i�f� �l�e�s�s� �t�h�a�n� �a� �s�e�c�o�n�d� �h�a�s� �p�a�s�s�e�d�.�
�
�
�
�#�#�#� ��t�i�m�e�U�n�t�i�l�(�d�a�t�e�)��
�
�
�
�� �C�o�n�v�e�r�t�s� �a� ��D�a�t�e��,� �t�i�m�e�s�t�a�m�p�,� �o�r� �d�a�t�e� �s�t�r�i�n�g� �i�n�t�o� �a� �h�u�m�a�n�-�f�r�i�e�n�d�l�y� � t�i�m�e� �u�n�t�i�l� �f�o�r�m�a�t�.�
�
�� �R�e�t�u�r�n�s� ��"�a�l�r�e�a�d�y� �p�a�s�s�e�d�"�� �i�f� �t�h�e� �d�a�t�e� �i�s� �i�n� �t�h�e� �p�a�s�t�.�
�
�
�
�-�-�-�
�
�
�
�#�#� �<�� �E�x�a�m�p�l�e�s�
�
�
�
����j�s�
�
�t�i�m�e�A�g�o�(�n�e�w� �D�a�t�e�(�D�a�t�e�.�n�o�w�(�)� �-� �6�0�0�0�0�)�)�;� � � � � �
�
�/�/� �"�1� �m�i�n�u�t�e� �a�g�o�"�
�
�
�
�t�i�m�e�A�g�o�(�D�a�t�e�.�n�o�w�(�)� �-� �8�6�4�0�0�0�0�0�)�;� � � � � � � � � � � �
�
�/�/� �"�1� �d�a�y� �a�g�o�"�
�
�
�
�t�i�m�e�U�n�t�i�l�(�D�a�t�e�.�n�o�w�(�)� �+� �3�6�0�0�0�0�0�)�;� � � � � � � � � � �
�
�/�/� �"�i�n� �1� �h�o�u�r�"�
�
�
�
�t�i�m�e�U�n�t�i�l�(�"�2�0�3�0�-�0�1�-�0�1�"�)�;� � � � � � � � � � � � � � � � � � �
�
�/�/� �"�i�n� �5� �y�e�a�r�s�"�
�
����
�
�
�
�-�-�-�
�
�
�
�#�#� �=��� �L�i�c�e�n�s�e�
�
�
�
�M�I�T� ��� �[�A�r�n�a�b� �S�a�r�k�a�r�]�(�h�t�t�p�s�:�/�/�g�i�t�h�u�b�.�c�o�m�/�a�r�n�a�b�2�3�6�)�
�
�
�
�-�-�-�
�
�
�
�
