This works for me:
z = 1920; t=DateTime.now.year; while (z<t) {++z}
If you are using a macro data source, you may or may not need to put the {% %} around them when entering it in, as well as usually macro data sources require an object as the source, not a list of numbers.