Converts an R POSIXct/POSIXt (or anything
as.POSIXlt() accepts) into a timezone-explicit Python datetime in UTC.
A value that is already a Python datetime is returned unchanged.
Details
The timezone is made explicit (UTC) on the Python side so that downstream code does not silently reinterpret a naive datetime in the local zone.
Examples
if (FALSE) { # \dontrun{
ts2pydatetime(Sys.time())
} # }