day#
- class day(obj, *args, start_date=None, **kwargs)[source]#
Convert a string, date/datetime object, or int to a day (int), the number of days since the start day. See also
sc.date()
andsc.daydiff() <daydiff>`()
. If a start day is not supplied, it returns the number of days into the current year.- Parameters:
- Returns:
the day(s) in simulation time (matching input data type where possible)
- Return type:
days (int or list)
Examples:
sc.day(sc.now()) # Returns how many days into the year we are sc.day(['2021-01-21', '2024-04-04'], start_date='2022-02-22') # Days can be positive or negative
New in version 1.0.0.New in version 1.2.2: renamed “start_day” to “start_date”