Раньше немного писал на PHP, решил подучить Python. И сразу возник вопрос. Импортирую я модуль datetitime. В нем есть класс datetime, из которого вызывается функция today()
from datetime import * today=datetime.today() print ('The type of today is:', type(today)) print ('The datetime is :',today) print ('The hour of today is :',today.hour)
The type of today is: <class 'datetime.datetime'> The datetime is : 2016-04-20 15:52:32.530972 The hour of today is : 15
. Поищу магические методы, думаю в них ответ.