I have a Perspective date time input with an onStartup script to give it the current datetime.
Would also like to have it zero the seconds if it can.
from datetime import date
self.props.value = system.date.now()
But manly I'd like the option to simply set it to the current datetime after the operator has set it to a few different dates.
Something like the "Today" option on the old MS Office DateTime Picker.
There is no need to import
If you want a date to have zero seconds that can be accomplished.
self.props.value = system.date.setTime(system.date.now(),hour,minutes,seconds)
The other is not a terrible Idea, you should create an Ideas post.
This seems to work:
date = system.date.now()
self.props.value = system.date.setTime(system.date.now(),system.date.getHour24(date),system.date.getMinute(date),0)
An expression binding of
now(0) will run once on startup so you can use this in any of the date/time inputs to set the date. e.g.,
For your application you want something like,