Skip to main content

Enumerate timestamps from now with offset in different units.

Project description

# tsenum

A timestamp generator.

## commands

```
usage: tsenum.py [-h] [--utc] --offset OFFSET --count COUNT --step
{day,week,hour,minute} --pattern PATTERN

Enumerate timestamps from now with offset in different units.

optional arguments:
-h, --help show this help message and exit
--utc, -u Current time is in UTC
--offset OFFSET, -o OFFSET
Offset to enumerate from
--count COUNT, -c COUNT
Count to enumerate
--step {day,week,hour,minute}, -s {day,week,hour,minute}
Step width
--pattern PATTERN, -p PATTERN
Date pattern to use (see Python's strftime in
datetime)
```

## example

Count 7 days back from yesterday.

```
tsenum.py --offset -1 --count -7 --step day --pattern "%Y-%m-%d: Hello world!"
2016-05-27: Hello world!
2016-05-28: Hello world!
2016-05-29: Hello world!
2016-05-30: Hello world!
2016-05-31: Hello world!
2016-06-01: Hello world!
2016-06-02: Hello world!
```

Count 3 weeks into future starting from now.

```
tsenum.py --offset 0 --count 3 --step day --pattern "Week %V"
Week 22
Week 22
Week 23
```

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

tsenum-0.1.tar.gz (9.6 kB view details)

Uploaded Source

File details

Details for the file tsenum-0.1.tar.gz.

File metadata

  • Download URL: tsenum-0.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tsenum-0.1.tar.gz
Algorithm Hash digest
SHA256 cc53aa422e3e93229cbbb7c813e5f4696acfad190655ce125f2ab58ff156beb3
MD5 a9d18f389120db0a9c24bae32190ecb6
BLAKE2b-256 fc05c0517c22b7a0582c416838183fce6692dd8931e45ec57725b4ff721cc80f

See more details on using hashes here.

Supported by

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