Use session start date with DatePickerSingle

Hi,

I’m new to Plotly, so I may be asking something really obvious. I’m using a DatePickerSingle component to let users select the date for the information they want to see. I’d like the initial date to be when the session starts, so that each user is initially offered the most current data, no matter when they open a session. I have set the date property in the layout, but then the initial date is when the server started, so all users are initially always seeing the same, earlier data. What do I need to do to begin the session with the current date?

Thanks in advance.

You can try this:
import datetime as dt

Then set “date” element of DatePickerSingle as the current time:
date = dt.datetime.now()

That works fine, but I want to do it if and only if we are at the beginning of a session. How do I know when I have a new session?