diff --git a/blogthon.cgi b/blogthon.cgi
index 8cdfa5a..8152472 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -158,6 +158,12 @@ if feed_display == "atom":
blog_title_md5sum = generate_uuid(blog_title)
title_md5sum = generate_uuid(title)
+ # Atom need a 2byte string
+ month = str(date[1])
+ day = str(date[2])
+ if len(str(date[1])) == 1: month = '0' + str(date[1])
+ if len(str(date[2])) == 1: day = '0' + str(date[2])
+
document_header("atom")
print ''
print ' '
@@ -165,13 +171,13 @@ if feed_display == "atom":
print ' '
print '
' + blog_title + ''
print ' urn:uuid:' + blog_title_md5sum + ''
- print ' ' + str(date[0]) + '-0' + str(date[1]) + '-' + str(date[2]) + 'T' + str(date[3]) + ':' + str(date[4]) + ':' + str(date[5]) + 'Z'
+ print ' ' + str(date[0]) + '-' + month + '-' + day + 'T' + str(date[3]) + ':' + str(date[4]) + ':' + str(date[5]) + 'Z'
print ''
print ' '
print ' ' + title + ''
print ' '
print ' urn:uuid:' + title_md5sum + ''
- print ' ' + str(date[0]) + '-0' + str(date[1]) + '-' + str(date[2]) + 'T' + str(date[3]) + ':' + str(date[4]) + ':' + str(date[5]) + 'Z'
+ print ' ' + str(date[0]) + '-' + month + '-' + day + 'T' + str(date[3]) + ':' + str(date[4]) + ':' + str(date[5]) + 'Z'
print ' '
print ''