Skip to main content

Convert a time units to seconds

Project description

Convert_ms

  • Use this package for converting units of time to seconds.

What is it?

from convert_ms import ms, check

ms("1m") # return 60
ms("1h") # return 3600
ms("1d") # return 86400

check("1m") # return True
check("1o") # return False

How to use ?

from convert_ms import ms, check
import asyncio

duration = "1h"

if check(query=duration):
    await asyncio.sleep(ms(query=duration))
else:
    print("you have entered a non-existent unit of time")

Formats

seconds, secs, s, m, min, minute, h, hour, d, day, w, week, mon, month, y, year

Find a bug?

Report here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

convert_ms-0.0.4.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

convert_ms-0.0.4-py3-none-any.whl (2.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page