Skip to content

Instantly share code, notes, and snippets.

@rojenzaman
Created January 19, 2021 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rojenzaman/9b17d7a26a77eb5fe836f6ec1238c246 to your computer and use it in GitHub Desktop.
Save rojenzaman/9b17d7a26a77eb5fe836f6ec1238c246 to your computer and use it in GitHub Desktop.
Create RSS pubDate with BASH
#format: Tue, 19 Jan 2021 19:07:07 +0300
TZ=`date +"%z"`
TIME=`date +"%H:%M:%S"`
WEEKDAY=`date +"%a"`
DATE=`date +"%d"`
MONTH=`date +"%b"`
YEAR=`date +"%Y"`
FORMATED_DATE_TIME="$WEEKDAY, $DATE $MONTH $YEAR $TIME $TZ"
echo "Formated time: $FORMATED_DATE_TIME"
@pointum
Copy link

pointum commented Oct 16, 2021

I’ve been looking for something like this. Turns out you can simply use date -R.

@rojenzaman
Copy link
Author

What a relief! Thanks for notice. I wish that I read manual for this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment