I'm writting a Python script that will look for newly created features and update them. This script will be automated to run every day at the end of the day. I'm using the Select by attribute tool to select features created on or before now (variable). I'm using UTC time zone because the "Create Date" field was created by the Enable Editor Tracking tool and by default the date is in UTC time zone.
import arcpy, datetime
from datetime import timezone
Now = datetime.datetime.now(timezone.utc)
arcpy.SelectLayerByAttribute_management(LayerName, "New_Selection", "CreateDate <= Now")
I'm getting an invalid expression error
arcgisscripting.ExecuteError: ERROR 000358: Invalid expression
Failed to execute (SelectLayerByAttribute).
How do I use the variable Now in the expression?