A hash key must be followed by a colon (:) syntax error Trying to get entries between two dates and am getting: 'A hash key must be followed by a colon (:). Unexpected token "operator" of value "~" ("punctuation" expected with value ":")' 

{% set posts = craft.entries({
    section: animal,
    orderBy: "postDate" })  %}


{% set puppyAnimals = posts({
    animalDateOfBirth: 'and',  "&gt;= " ~ now|date , '&lt;=' ~ now|date_modify('-1 year')|date })  %}


It's Craft 3 so I may just have the syntax wrong.
You're nearly there! The and query you’re building just needs to be declared as an array:

{% set puppyAnimals = craft.entries({
    section: 'animals',
    orderBy: 'postDate',
    animalDateOfBirth: ['and',  "&lt;= #{now | atom}", "&gt;= #{now | date_modify('-1 year') | atom}"]
}).all()  %}


The brackets around the value provided for animalDateOfBirth was being interpreted as a single string, followed by a missing key.

(I also opted for Twig’s interpolation syntax to make the series of array elements a little clearer, and used the atom filter to produce fully-qualified dates)


  One more note: I switched the greater-than and less-than operators, as I suspect the query would have returned no results—(after today, but earlier than last year)!