Quote:
Originally Posted by ownedbycats
Ah, that makes sense. For future, is there a way to edit the time part of date column directly, aside from maybe changing the column format?
|
Not that I can think of. Perhaps an SFE in action chains along with some dialog to capture the date.
Here is a template that changes the date (timestamp) to whatever you put in line 9. Be sure to get an example so the timezone is correct.
Code:
python:
def evaluate(book, context):
db = context.db.new_api
# Get the current timestamp.
v = db.field_for('timestamp', book.id)
print(1, v)
# The corrected timespamp goes here
db.set_field('timestamp', {book.id: '2023-06-23 09:36:34+00:00'})
# See if the timestamp changed.
v = db.field_for('timestamp', book.id)
print(2, v)
# return the new timestamp
return str(v)