Fallback for systems without "date -R" (OSX).
Fixed unsequences access to variable.