Skip to main content

A Random Timestamp Generator

Project description

random_timestamp

A Random Timestamp Generator

Installation

Dependences

* This app only

Installation

*Installation with pip (recommended)*

    *Pip will download and install the package and take care of all the dependences.
    If you havn't pip on your system then install setuptools first after that run "easy_install pip".
    After that you can use pip in your terminal window.*

    * Use the stable release (recommended)::

        pip install random_timestamp

    * With pip you can also uninstall::

        pip uninstall random_timestamp

Usage

The function random_timestamp takes four optional arguments:

random_timestamp(year=1900, month=1, day=1, part='DATE/TIME')

If year and month and day are not inputed, the timestamp will be randomly generated between 1900 and today's date (datetime.now().date())).

If a later date after today is inputed, the output date will be today's date as well. The optional part parameter is to select only the date or time portion of the timestamp to output.

>>> from random_timestamp import random_timestamp

>>> random_timestamp()
datetime.datetime(1986, 5, 31, 2, 50, 5)

>>> random_timestamp(2020)
datetime.datetime(2020, 2, 11, 12, 4, 51)

>>> random_timestamp(month=1)
datetime.datetime(1914, 1, 15, 22, 3, 58)

>>> random_timestamp(2020, 4, 16, 'DATE')
datetime.date(2020, 4, 16)

>>> random_timestamp(part='TIME')
datetime.time(10, 59, 6)

License

This project is released under GNU GENERAL PUBLIC LICENSE V3.

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

random_timestamp-1.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

random_timestamp-1.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file random_timestamp-1.1.tar.gz.

File metadata

  • Download URL: random_timestamp-1.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for random_timestamp-1.1.tar.gz
Algorithm Hash digest
SHA256 a5b789aef967e0fdeb7cc45c5cdb7364f591cec6b3738aa3921a2dab707f8285
MD5 f0661d32fb5295d70b3389e8a1b5dc21
BLAKE2b-256 3d900aaad7e354f6f093355cc435ae76086c25f22823bf690ae0a87c99320750

See more details on using hashes here.

File details

Details for the file random_timestamp-1.1-py3-none-any.whl.

File metadata

  • Download URL: random_timestamp-1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for random_timestamp-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f72965726da14927b7037dec00bcd29fc7506cb61ae617f08ce4115923f0f2b
MD5 a477b13b2a33ce01b55e4eef6dfe2013
BLAKE2b-256 92291d63f770b81de7e2c2bdd0d3852bef16f78219ecfce2eb306bbbc8913168

See more details on using hashes here.

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