Discussione:
Data futura
Aggiungi Risposta
BIG Umberto
2025-01-24 22:43:07 UTC
Rispondi
Permalink
Devo calcolare che giorno (g,m,a) sarà, per esempio, tra 60 giorni
usando "date".
Non ho disponibile un linux, ma devo farlo su un cellulare con
android tramite emulatore termux (shell di bash).
Non mi ricordo più la sintassi di date!!!
--
Fondamentalmente innocuo.
Qihe
2025-01-24 23:00:27 UTC
Rispondi
Permalink
Post by BIG Umberto
Devo calcolare che giorno (g,m,a) sarà, per esempio, tra 60 giorni
usando "date".
Non ho disponibile un linux, ma devo farlo su un cellulare con
android tramite emulatore termux (shell di bash).
Non mi ricordo più la sintassi di date!!!
$ date MMDDhhmm
(Month,Day,hour,minute)

Oppure
$ date --date "next month"
--
Qihe
BIG Umberto
2025-01-24 23:40:10 UTC
Rispondi
Permalink
Post by Qihe
Post by BIG Umberto
Devo calcolare che giorno (g,m,a) sarà, per esempio, tra 60 giorni
usando "date".
Non ho disponibile un linux, ma devo farlo su un cellulare con
android tramite emulatore termux (shell di bash).
Non mi ricordo più la sintassi di date!!!
$ date MMDDhhmm
(Month,Day,hour,minute)
Oppure
$ date --date "next month"
date --date "60 day"
date +%a-%d/%m/%Y --date "60 day"

Grazie
--
Fondamentalmente innocuo.
BIG Umberto
2025-01-25 16:55:23 UTC
Rispondi
Permalink
Post by BIG Umberto
Post by Qihe
Post by BIG Umberto
Devo calcolare che giorno (g,m,a) sarà, per esempio, tra 60 giorni
usando "date".
Non ho disponibile un linux, ma devo farlo su un cellulare con
android tramite emulatore termux (shell di bash).
Non mi ricordo più la sintassi di date!!!
$ date MMDDhhmm
(Month,Day,hour,minute)
Oppure
$ date --date "next month"
date --date "60 day"
date +%a-%d/%m/%Y --date "60 day"
Un paio di calcoli fra date:

$ cat giorni

read -p "giorno mese anno: " g m a

d0=$(date +%m/%d/%Y -d 'today')
d1=$(date +%s -d "$d0")
d2=$(date +%s -d "$m/$g/$a")
ss=$((d2 - d1))
gg=$((ss / 86400))
echo "giorni $gg"
echo


cat datario

read -p "giorni futuri: " a
date +"%a, %d %b %Y" --date="${a} day"
echo
--
Fondamentalmente innocuo.
Qihe
2025-01-24 23:43:34 UTC
Rispondi
Permalink
Post by Qihe
Post by BIG Umberto
Devo calcolare che giorno (g,m,a) sarà, per esempio, tra 60 giorni
usando "date".
Non ho disponibile un linux, ma devo farlo su un cellulare con
android tramite emulatore termux (shell di bash).
Non mi ricordo più la sintassi di date!!!
$ date MMDDhhmm
(Month,Day,hour,minute)
Qui sopra ho sbagliato, scusa.
Post by Qihe
Oppure
$ date --date "next month"
Oppure così ti dice ad es. il 25 feb 2025:
$ date -d "2025-02-25"
--
Qihe
Lem Novantotto
2025-01-24 23:43:06 UTC
Rispondi
Permalink
Post by BIG Umberto
Devo calcolare che giorno (g,m,a) sarà, per esempio, tra 60 giorni
usando "date".
date +%d/%m/%Y -d "+60 days"
--
Bye, Lem
Talis erit dies qualem egeris
BIG Umberto
2025-01-24 23:53:10 UTC
Rispondi
Permalink
Post by Lem Novantotto
Post by BIG Umberto
Devo calcolare che giorno (g,m,a) sarà, per esempio, tra 60 giorni
usando "date".
date +%d/%m/%Y -d "+60 days"
--
Bye, Lem
Talis erit dies qualem egeris
Grazie anche a te
--
Fondamentalmente innocuo.
Loading...