pilasguru

Pide fecha, hora y duración. Retorna fecha hora fin.

Sep 30th, 2014
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. FECHA=$(zenity --calendar --text="Seleccione fecha del evento" --date-format=%Y-%m-%d)
  3. INICIO=$(zenity --entry --text="Indique hora de comienzo, ej: 21:30")
  4. DURACION=$(zenity --entry --text="Indique duración del evento en horas")
  5. FIN=`echo $(date --date "$FECHA $INICIO" +%s) + $(($DURACION*3600)) | bc -l`
  6. zenity --info --text="Evento finaliza el:\n$(date -d@$FIN +%d/%b/%Y' a las '%H:%M)"
Advertisement
Add Comment
Please, Sign In to add comment