Unfortunately the DateTimeConverter does not accept week flags an input, so we can't do something as simple as %G%V%w.
We can do this in python with the datetime module. The caveat is that ISO weeks start with an index of 0, not 1. So 202102 would be the 3rd week in january and therefore January 16th, not 9th.
import datetime
def processFeature(feature):
yw = str(feature.getAttribute('input'))
d = datetime.datetime.strptime(yw+'6', '%G%V%w')
o = d.strftime('%Y%m%d')
feature.setAttribute("Date", o)
The 6 in the code above indicates that you want saturday.
Unfortunately the DateTimeConverter does not accept week flags an input, so we can't do something as simple as %G%V%w.
We can do this in python with the datetime module. The caveat is that ISO weeks start with an index of 0, not 1. So 202102 would be the 3rd week in january and therefore January 16th, not 9th.
import datetime
def processFeature(feature):
yw = str(feature.getAttribute('input'))
d = datetime.datetime.strptime(yw+'6', '%G%V%w')
o = d.strftime('%Y%m%d')
feature.setAttribute("Date", o)
The 6 in the code above indicates that you want saturday.
Thank you very much. This works well for me.