How to manually create pubDate tag in RSS xml using Linux date command ?

We wanted to create an rss xml for our one website, but we had forgotten when was the last time we created this URL,

rss xml has a tag called pubDate which tells the rss feed parsers when the URL was created. And the format of this Tag is as below,

<pubDate>Wed, 09 Aug 2017 13:25:47 +0530</pubDate>

so we created the pubDate xml tag compatible date & time using below script as,

#format - Wed, 09 Aug 2017 13:25:47 +0530
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 "print compatible date format $FORMATED_DATE_TIME"

You run the script like below on ubuntu console,

$ bash format-date.sh 
print compatible date format Sun, 13 Aug 2017 00:51:41 +0530
Ezoic Title Tag Tester - Improve yo... x
Ezoic Title Tag Tester - Improve you CTR

1 thought on “How to manually create pubDate tag in RSS xml using Linux date command ?”

Leave a Comment

Sign up to our newsletter!

ADB Commands Android Android Applications Android Build system Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development, Debugging and Performance Tools Development and Build Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia NDK / Middleware / HAL Operating System Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web Design and Development Website Hosting Wordpress Yocto Embedded Linux