Skip to main content

A function to get a Timestamp string in the format YYYY_MM_DD_HH_MM_SS_microseconds ('_' can be defined)

pip install gettimestamp

Tested against Windows 10 / Python 3.10 / Anaconda

The function takes an optional sep argument, which represents the separator character used in the timestamp string. By default, the separator is set to "_".

The function utilizes the datetime module to retrieve the current date and time. It formats the timestamp using the provided separator and includes the year, month, day, hour, minute, second, and microseconds.

The resulting timestamp string is returned by the function. However, if the separator is set to "ÇÇÇÇSXÇX", a ValueError is raised to prevent the use of that specific separator.

        Args:
            sep (str, optional): Separator character to use in the timestamp string. Defaults to "_".

        Returns:
            str: Timestamp string in the format "YYYY_MM_DD_HH_MM_SS_microseconds".

        Raises:
            ValueError: Raised when the separator is set to "ÇÇÇÇSXÇX".

        Example:
            from gettimestamp import get_timestamp
            >>> get_timestamp()
            '2023_06_26_15_30_45_123456'
            >>> get_timestamp("-")
            '2023-06-26-15-30-45-123456'

Metadata

Release files for gettimestamp 0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gettimestamp 0.11
File Size Uploaded Provenance Actions
gettimestamp-0.11.tar.gz 3.3 kB Without provenance Details for gettimestamp-0.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gettimestamp 0.11
File Interpreter ABI Platform Actions
gettimestamp-0.11-py3-none-any.whl Python 3 none any Details for gettimestamp-0.11-py3-none-any.whl

Total release size: 7.9 kB

Release files / gettimestamp-0.11.tar.gz

Download URL gettimestamp-0.11.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8fc2d590e501d8f796566d3b5df2e234d59535b7a75a5cf59903d301422f3cce
BLAKE2b-256 checksum
How to use checksums
0c634bd78844b267be237671e98cb19bf34afbee8211c986c5a4609eb69d33f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / gettimestamp-0.11-py3-none-any.whl

Download URL gettimestamp-0.11-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac1775be5bee29e87c9fa3de1e6fb000a0ffaa15f35f67231f7b873b30bcdead
BLAKE2b-256 checksum
How to use checksums
514819fc67b88a77e1857ea291124cad7dc484d525372b9856abfcd6362cbed8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Security for gettimestamp 0.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.11 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page