Ignore:
Timestamp:
17 Apr 2012, 11:19:55 (13 years ago)
Author:
uli
Message:

Let to_timezone ignore not-datetimes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py

    r8185 r8192  
    569569
    570570    If no `tz` is given, shift to UTC is performed.
    571     """
     571
     572    If `dt` is not a datetime.datetime, the input value is returned
     573    unchanged.
     574    """
     575    if not isinstance(dt, datetime.datetime):
     576        return dt
    572577    if tz is None:
    573578        tz = pytz.utc
Note: See TracChangeset for help on using the changeset viewer.