5281670
I posted the following to a Blogger developers’
discussion,
and thought it might be useful reposting it here as
search engine fodder.
Igor Mousse wrote:
Developers: BlogItemDateTime : date format
Could you add more option to the BlogItemDateTime tag?
Especially concerning the order of day and month. In
France, and in many other countries, we write a date
like that: day/month/year instead of month/day/year
like you do.Thanks a lot. Blogger is great!
If you have SSI and Perl enabled on your machine, you
might want to try the following. This solution has the
advantage of working on browsers that do not support
Javascript, as opposed to Mr. Ringnalda’s fine
solution. These instructions presume an Apache server,
a UNIX-type OS, and a shell account (you will have to
adjust some instructions if this does not properly
reflect your system.)
- Configure Blogger (in ‘Settings’) to use the
‘Date/Time Format’ that looks like ‘8/16/2001 11:37:59
AM’. Set the ‘Date Header Format’ to look like
‘Thursday, August 16, 2001′. - Copy the following (everything between, but not
including, the ***s) into a text editor, save it as
‘reformatdate.pl’, and upload to your server.**************** #!/usr/bin/perl # Routine for reformatting Blogger dates. # Performs the following translations: # 8/16/2001 1:37:59 PM' -> # '16 August 2001 13:37:59' # Thursday, August 16, 2001' -> # 'Thursday, 16 August 2001' # Written by Joshua McGee ( http://www.mcgees.org |joshua@mcgees.org ) die unless ($indate = shift); @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); if (($m,$d,$y,$h,$mi,$s,$pm) = ($indate =~ m|^\s*(\d+)/(\d+)/(\d+) (\d+):(\d+):(\d+) (.)M$\s*|)) { $h += 12 unless ($pm eq 'A'); $m--; print "$d $months[$m] $y $h:$mi:$s\n"; } elsif (($w,$m,$d,$y) = ($indate =~ m|^\s*(\w+), (\w+) (\d+), (\d+)\s*$|)) { print "$w, $d $m $y\n"; } **************** - Change the script file permissions to be
world-readable and -executable (type “chmod 755
reformatdate.pl” in the scripts directory.) - Everywhere you want
<$BlogItemDateTime$>,
use:<!--#exec
cmd="/script_directory/reformatdate.pl
'<$BlogItemDateTime$>'" -->Note that ‘/script_directory/’ is an absolute path
on the machine itself, not relative to the
HTML root. That is, it will probably look something
like ‘/home/users/foo/www/html/scripts/‘. Typepwd
in the scripts directory to get the correct
path. - For
<$BlogDateHeaderDate$>, just replace
<$BlogItemDateTime$>with
<$BlogDateHeaderDate$>in step 4. - That’s it.

















