Returns a datetime object of the month, day, year, and time the game
        was played.
495781
def datetime(self):
        
        date_string = '%s %s' % (self._date, self._year)
        date_string = re.sub(r' \(\d+\)', '', date_string)
        return datetime.strptime(date_string, '%A, %b %d %Y')
668251
def to_date(dt, tzinfo=None, format=None):
    
    d = to_datetime(dt, tzinfo, format)
    if not d:
        return d
    return date(d.year, d.month, d.day)
676529
function DateTime(date) {
        if (date instanceof DateTime)
            return date;
        if (_i18n_locale.locale_name == 'en_DEBUG') 
            date = new Date(3333, 10, 22, 11, 22, 33, 123);
        if (date instanceof Date) {
            this.date = date;
            this.hour = date.getHours();
            this.minute = date.getMinutes();
            this.second = date.getSeconds();
            this.microsecond = 0;
            this.year = date.getFullYear();
            this.month = date.getMonth()+1;
            this.day = date.getDate();
        } else {
            for(var k in date) {
                this[k] = date[k];
            }
        }
    }
739391
def get_opening_day_game(year)
      schedule = Schedule.new(year)
      oday = schedule.get_opening_day
      oday_array = GamedayUtil.parse_date_string(oday)
      games = games_for_date(oday_array[0], oday_array[1], oday_array[2])
      if games[0] == nil
        games = games_for_date(oday_array[0], 
                               oday_array[1], 
                               GamedayUtil.convert_digit_to_string(oday_array[2].to_i + 1))
      end
      return games[0]
    end
436963
def datetime_from_json(js, manager):
    """"""
    if js is None:
        return None
    else:
        return dt.datetime(
            js['year'],
            js['month'] + 1,  # Months are 1-based in Python
            js['date'],
            js['hours'],
            js['minutes'],
            js['seconds'],
            js['milliseconds'] * 1000
        )
873467
def um_date_to_date(d):
    

    return datetime.datetime(year=d[0], month=d[1], day=d[2],
                             hour=d[3], minute=d[4], second=d[5])
268749
def date(date):
    
    date = date.value
    return (datetime.strptime(date[:-5], '%Y-%m-%dT%H:%M:%S')
            if len(date) == 24
            else datetime.strptime(date, '%Y%m%dT%H:%M:%S'))
1114050
def get_start_date(self):
        
        sdate = self._my_map['startDate']
        return DateTime(
            sdate.year,
            sdate.month,
            sdate.day,
            sdate.hour,
            sdate.minute,
            sdate.second,
            sdate.microsecond)
176602
def _get_datetimes(self, timestep=1):
        """"""
        start_moy = DateTime(self._month, self._day_of_month).moy
        if timestep == 1:
            start_moy = start_moy + 30
        num_moys = 24 * timestep
        return tuple(
            DateTime.from_moy(start_moy + (i * (1 / timestep) * 60))
            for i in xrange(num_moys)
        )
1336833
def get_date(self):
        
        year = self.get_year()
        month = self.get_month()
        day = self.get_day()

        return _date_from_string(year, self.get_year_format(),
                                 month, self.get_month_format(),
                                 day, self.get_day_format())
1208163
def monthly(date=datetime.date.today()):
    
    return datetime.date(date.year, date.month, 1)
1325239
def int_to_date(date):
    

    year = date // 10**4
    month = date % 10**4 // 10**2
    day = date % 10**2

    return datetime.date(year, month, day)
1013365
def datetime(self):
        ''
        index = self.data.index.remove_unused_levels()
        return pd.to_datetime(index.levels[0])
521178
def date(self):
        ''' 
        '''
        utcnow = datetime.utcnow()
        return (utcnow + timedelta(hours=self.time_zone)).date()
877005
def get_timestamp(timezone_name, year, month, day, hour=0, minute=0):
    """"""
    tz = pytz.timezone(timezone_name)
    tz_datetime = tz.localize(datetime(year, month, day, hour, minute))
    timestamp = calendar.timegm(tz_datetime.utctimetuple())
    return timestamp
701704
def to_datetime(date):
    """"""
    return datetime.datetime(date.year, date.month, date.day)
160987
def gt=(gt)
      @gt =  Array(gt).empty? ? ["7:00 PM"] : Array(gt)
      @gt.collect! do |gt|
        begin
          DateTime.parse(gt)
        rescue
          raise "game times must be valid time representations in the string form (e.g. 3:00 PM, 11:00 AM, 18:20, etc)"
        end
      end
    end