Skip to content

Calculate date & time with precision from seconds to millenniums. Human friendly date time as string. ISO-8601 representation and more.

License

juancarlospaco/nim-datetime2human

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 

nim-datetime2human

Calculate date & time with precision from seconds to millenniums. Human friendly date time as string. ISO-8601.

screenshot

Use

>>> import datetime2human
>>> echo datetime2human(now())
(human: "5 Decades 2 Years 6 Months 2 Weeks 3 Days 2 Hours 4 Minutes 16 Seconds", short: "5 Decades", iso: "2018-05-05 23:04:16-03:00", units: (seconds: 16, minutes: 4, hours: 2, days: 3, weeks: 2, months: 6, years: 2, decades: 5, centuries: 0, millenniums: 0))
echo now2human()
(human: "5 Decades 2 Years 6 Months 2 Weeks 3 Days 2 Hours 4 Minutes 16 Seconds", short: "5 Decades", iso: "2018-05-05 23:04:16-03:00", units: (seconds: 16, minutes: 4, hours: 2, days: 3, weeks: 2, months: 6, years: 2, decades: 5, centuries: 0, millenniums: 0))
>>>

Install

nimble install datetime2human

Requisites

Documentation

datetime2human()

Description: Calculate date & time with precision from seconds to millenniums. Human friendly date time as string. ISO-8601 representation. The proc only accepts DateTime.

Arguments:

  • datetime_obj A valid DateTime object, DateTime type, required.

Returns: HumanTimes type, a tuple.

now2human()

Description: Now expressed as human friendly time units string, Just a shortcut to datetime2human.

Arguments: None.

Returns: HumanTimes type, a tuple.

About

Calculate date & time with precision from seconds to millenniums. Human friendly date time as string. ISO-8601 representation and more.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages