All Samples(2160) | Call(1793) | Derive(48) | Import(319)
time([hour[, minute[, second[, microsecond[, tzinfo]]]]]) --> a time object All arguments are optional. tzinfo may be None, or an instance of a tzinfo subclass. The remaining arguments may be ints or longs.
src/o/b/objectlistview-HEAD/python/trunk/Examples/Demo.py objectlistview(Download)
__version__ = "1.1" from datetime import datetime, time import os import random from time import clock, strptime
for x in self.dataObjects:
# Convert the 'duration' and 'lastPlayed' attributes into a time() and a datetime() respectively
minsAndSeconds = x.duration.split(":")
x.duration = time(minute=int(minsAndSeconds[0]), second=int(minsAndSeconds[1]))
x.lastPlayed = datetime(*(strptime(x.lastPlayed, "%d/%m/%Y %H:%M")[0:6]))
# Give some tracks a dark colour that can be used for the text
src/p/s/psycopg2-HEAD/examples/dt.py psycopg2(Download)
dt1 = (
2,
datetime.date(2004, 10, 19),
datetime.time(0, 11, 17, 15000),
datetime.datetime(2004, 10, 19, 0, 11, 17, 500000),
datetime.timedelta(13, 15*3600+17*60+59, 900000))
src/p/s/psycopg2-2.2.2/examples/dt.py psycopg2(Download)
dt1 = (
2,
datetime.date(2004, 10, 19),
datetime.time(0, 11, 17, 15000),
datetime.datetime(2004, 10, 19, 0, 11, 17, 500000),
datetime.timedelta(13, 15*3600+17*60+59, 900000))
src/p/s/psycopg2da-2.0.9/examples/dt.py psycopg2da(Download)
dt1 = (
2,
datetime.date(2004, 10, 19),
datetime.time(0, 11, 17, 15000),
datetime.datetime(2004, 10, 19, 0, 11, 17, 500000),
datetime.timedelta(13, 15*3600+17*60+59, 900000))
src/p/y/pyjamas-0.7/examples/libtest/DatetimeModuleTest.py Pyjamas(Download)
def testTime(self):
t = datetime.time(9, 45, 11, 95000)
self.assertEqual(t.hour, 9)
self.assertEqual(t.minute, 45)
self.assertEqual(t.second, 11)
self.assertEqual(t.microsecond, 95000)
src/d/j/django-roa-1.6/examples/django_roa_client/tests.py django-roa(Download)
application into your own project, otherwise it will fail. Django do not handle very well projects inside projects. """ from datetime import time, date, datetime from decimal import Decimal from django.test import TestCase
def test_time_field(self):
page = RemotePageWithManyFields.objects.create(time_field=time(3, 51, 28))
self.assertEqual(repr(page.time_field), 'datetime.time(3, 51, 28)')
page = RemotePageWithManyFields.objects.get(id=page.id)
self.assertEqual(repr(page.time_field), 'datetime.time(3, 51, 28)')
page.time_field = time(11, 20, 53)
page.save()
src/a/p/appscript-HEAD/py-appscript/trunk/appscript_3x/sample/appscript/Add_iCal_event.py appscript(Download)
# (note: when only time is given, appscript uses current date) calendarname = 'Home' start = datetime.time(19, 0, 0) # 7 pm end = datetime.time(21, 0, 0) # 9 pm summary = 'Watch dinner & eat teevee'
src/a/p/appscript-HEAD/py-appscript/trunk/appscript_2x/sample/appscript/Add_iCal_event.py appscript(Download)
# (note: when only time is given, appscript uses current date) calendarname = 'Home' start = datetime.time(19, 0, 0) # 7 pm end = datetime.time(21, 0, 0) # 9 pm summary = 'Watch dinner & eat teevee'
src/a/p/appscript-0.21.1/appscript_3x/sample/appscript/Add_iCal_event.py appscript(Download)
# (note: when only time is given, appscript uses current date) calendarname = 'Home' start = datetime.time(19, 0, 0) # 7 pm end = datetime.time(21, 0, 0) # 9 pm summary = 'Watch dinner & eat teevee'
src/a/p/appscript-0.21.1/appscript_2x/sample/appscript/Add_iCal_event.py appscript(Download)
# (note: when only time is given, appscript uses current date) calendarname = 'Home' start = datetime.time(19, 0, 0) # 7 pm end = datetime.time(21, 0, 0) # 9 pm summary = 'Watch dinner & eat teevee'
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next