soltrack.time module

class soltrack.time.Time[source]

Bases: object

Class containing the date and time (in UTC) to compute the Sun position for.

now()[source]

Return the current system time as a SolTrack time object.

Returns:

Current system date and time in a SolTrack time object.

setDateAndTime(year=2000, month=1, day=1, hour=12, minute=0, second=0.0)[source]

This function is obsolescent and will be removed in a future version. Use set_date_and_time() instead.

setDateTime(dt_obj, utc=False)[source]

This function is obsolescent and will be removed in a future version. Use setDateTime() instead.

set_date_and_time(year=2000, month=1, day=1, hour=12, minute=0, second=0.0)[source]

Set the SolTrack date and time using UTC year, month, day, hour, minute and second.

Parameters:
  • year (int) – year of date.

  • month (int) – month of date.

  • day (int) – day of date.

  • hour (int) – hour of day (default=0).

  • minute (int) – minute of time (default=0).

  • second (float) – second of time (default=0).

Note

Use set_date_time() instead if you have a Python datetime object.

set_date_time(dt_obj, utc=False)[source]

Set the SolTrack date and time using a (local) Python datetime object.

Parameters:

dt_obj (datetime(64)) – Date and time in a Python datetime object (UTC if timezone naive).

Returns:

Date and time in a SolTrack time object.

Return type:

Time

Note

Use set_date_and_time() instead if you have year, month,day, hour, minute and second as separate variables.