How can you increase dates in a shell?

2

Description:

I need to take a date in dd / mm / yyyy format and increase the day.

For example, having a date 01/01/2017 , the idea is to have the following output:

02/01/2017

Code:

I am trying with date -d "${fecha_ultimo_proceso} + 1 day" "+%d/%m/%y" , but I am taking the date format in English ( mm / dd / yyyy )

The test I'm doing is:

#/bin/bash

fecha_ultimo_proceso="01/05/2017"

date -d "${fecha_ultimo_proceso} + 1 day" "+%d/%m/%y"

and the output I have is:

06/01/17

Note:

Maybe I have to do some configuration in my OS? I'm using Ubuntu 14.04

    
asked by Alejandro Montilla 06.01.2017 в 21:29
source

1 answer

2

Try this code:

date +%d/%m/%Y -d "$DATE + $i day"
    
answered by 08.01.2017 / 14:37
source