Skip to content

PaulHerk/date-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adp - append dates

Add dates to your sources now!!!

1. Usage

apd [OPTIONS] --start-date <START_DATE>

2. Options

Command short/long Description Default Value
-i / --input Input file None
-o / --output Output file None
-s / --start-date The date when to start REQUIRED
-e / --end-date The date when to end 0 (today), see more here
-d / --day_range The range in the day from when to pick values (not inclusive) "9-20", see more here
-f / --format The format for the output "[day].[month].[year] [hour]:[minute]", see more here
-h / --help Print help
-v / --version Print version

Date

There are two different options to represent dates.

  1. First YYYY-MM-DD_HH
  • Example: -s 2023-4-01_18
  1. Second Days from now (signed integers)
  • Example 1: -s -5 (5 days ago)
  • Example 2: -e 4 (in 5 days)

Format

You can customize the format as you want with these arguments:

  • [year]
  • [month]
  • [day]
  • [hour]
  • [minute]
  • [second]

For more Information read this and you can also find the complete argument list here. You can put basically anything in the string.

Example: -o "[second]:[minute]_[unix_timestamp] [weekday repr:short],[day]"

Day Range

You can customize the range when to pick the hours with this. 24 is no valid hour.

  • Example 1: -d "5-12"

Choose values from 5:00 to 11:59

  • Example 2: -d "0-0"

If you put the same values twice, it means that every hour is possible

  • Example 3: -d "3-1"

Will fail, because start is bigger than end

3. Examples

  1. apd -i input.txt -s -7

start last week, end now

  1. apd -i sources.txt -s 2023-02-01_00 -e -1 output.txt

start on the 01.02.2023 at 00:00, end yesterday, output is output.txt

4. Features

  • Append random dates
  • Format customization
  • Relative dates
  • Remove all .unwrap()
  • No night mode
  • create a website for it
  • read input so a external file isn't needed
  • optimise links