Computer Date and Language Shell Script

Asked

Viewed 331 times

2

Is there any shell script function that takes the date and time (time zone) and language that are configured on the computer?

  • I think this might work: date +%d/%m/%Y" - "%H:%M:%S

1 answer

1

This should be trivial, actually:

#!/bin/sh

# script /tmp/tes.sh

language=$LANG                    # Idioma
date=$(date +"%d-%m-%Y %H:%M:%S") # Data e hora local
timezone_offset=$(date +%z)       # Fuso horário

Browser other questions tagged

You are not signed in. Login or sign up in order to post.