Filtering by date

Is this how one should filter by date? I feel I have tried almost anything.

if (cutoffDate != null) {
query = query.query(‘syncedAt>$0, $cutoffDate’);
}