Skip to main content
Help us improve Python packaging – donate today!

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)
```
## Usage (Module)

Count 7 days back from yesterday.

```
from tsenum import enumerate_times
from datetime import datetime

enumerate_times(datetime.now(), -1, -7, 'day', '%Y-%m-%d')
```

## Usage (CLI)

Count 7 days back from yesterday.

```
tsenum --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 --offset 0 --count 3 --step day --pattern "Week %V"
Week 22
Week 22
Week 23
```

Release history Release notifications

This version
History Node

1.0.0

History Node

0.2.1

History Node

0.2

History Node

0.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
tsenum-1.0.0.tar.gz (10.7 kB) Copy SHA256 hash SHA256 Source None May 29, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page