Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(86688)  |  Call(55946)  |  Derive(261)  |  Import(30481)
DateTime objects represent instants in time and provide
interfaces for controlling its representation without
affecting the absolute value of the object.

DateTime objects may be created from a wide variety of string
or numeric data, or may be computed from other DateTime objects.
DateTimes support the ability to convert their representations
to many major timezones, as well as the ablility to create a
DateTime object in the context of a given timezone.
(more...)

src/e/x/example.conference-HEAD/example/conference/program.py   example.conference(Download)
from Acquisition import aq_inner
from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from example.conference import _
from example.conference.session import ISession
def startIndexer(obj):
    if obj.start is None:
        return None
    return DateTime(obj.start.isoformat())
grok.global_adapter(startIndexer, name="start")
def endIndexer(obj):
    if obj.end is None:
        return None
    return DateTime(obj.end.isoformat())
grok.global_adapter(endIndexer, name="end")

src/e/r/erp5-HEAD/product/ERP5/mixin/periodicity.py   erp5(Download)
##############################################################################
 
from DateTime import DateTime
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
      month += 1
 
    return DateTime(year, month, 1, 0, 0, 0, timezone)
 
  def _getNextDay(self, date, timezone):
    if timezone is not None:
      new_date = DateTime(date.timeTime() + 86400.0, timezone)
    else:
      new_date = DateTime(date.timeTime() + 86400.0)
    while new_date.day() == date.day():
      if timezone is not None:
        new_date = DateTime(new_date.timeTime() + 3600.0, timezone)
      else:
        new_date = DateTime(new_date.timeTime() + 3600.0)

src/b/i/bika.lims-3.01a/bika/lims/content/referencesample.py   bika.lims(Download)
"""ReferenceSample represents a reference sample used for quality control testing
"""
 
from AccessControl import ClassSecurityInfo
from DateTime import DateTime
    def current_date(self):
        return DateTime()
 
    def getReferenceDefinitions(self):
 
        maxtime = service.getMaxTimeAllowed() and service.getMaxTimeAllowed() \
            or {'days':0, 'hours':0, 'minutes':0}
        starttime = DateTime()
        max_days = float(maxtime.get('days', 0)) + \
                 (
    def workflow_script_expire(self, state_info):
        """ expire sample """
        self.setDateExpired(DateTime())
        self.reindexObject()
 
    def workflow_script_dispose(self, state_info):
        """ expire sample """
        self.setDateDisposed(DateTime())

src/b/i/bika.lims-3.01a/bika/lims/browser/sample.py   bika.lims(Download)
from AccessControl import getSecurityManager
from DateTime import DateTime
from Products.Archetypes.config import REFERENCE_CATALOG
from Products.Archetypes.public import DisplayList
from Products.CMFCore.utils import getToolByName
    def now(self):
        return DateTime()
 
    def getDefaultSpec(self):
        """ Returns 'lab' or 'client' to set the initial value of the
                self.context.bika_setup.getSamplingWorkflowEnabled()
 
            if not samplingdate > DateTime() and SamplingWorkflowEnabled:
                datesampled = self.ulocalized_time(obj.getDateSampled())
                if not datesampled:
                    (self.context.translate(_("Hazardous")),
                     self.portal_url)
            if obj.getSamplingDate() > DateTime():
                after_icons += "<img title='%s' " \
                    "src='%s/++resource++bika.lims.images/calendar.png' >" % \
            checkPermission = self.context.portal_membership.checkPermission
            if checkPermission(SampleSample, obj) \
                and not samplingdate > DateTime():
                items[x]['required'] = ['getSampler', 'getDateSampled']
                items[x]['allow_edit'] = ['getSampler', 'getDateSampled']

src/b/i/Bika-LIMS-HEAD/bika/lims/content/referencesample.py   Bika-LIMS(Download)
"""ReferenceSample represents a reference sample used for quality control testing
"""
 
from AccessControl import ClassSecurityInfo
from DateTime import DateTime
    def current_date(self):
        return DateTime()
 
    def getReferenceDefinitions(self):
 
        maxtime = service.getMaxTimeAllowed() and service.getMaxTimeAllowed() \
            or {'days':0, 'hours':0, 'minutes':0}
        starttime = DateTime()
        max_days = float(maxtime.get('days', 0)) + \
                 (
    def workflow_script_expire(self):
        """ expire sample """
        self.setDateExpired(DateTime())
        self.reindexObject()
 
    def workflow_script_dispose(self):
        """ dispose sample """
        self.setDateDisposed(DateTime())

src/b/i/Bika-LIMS-HEAD/bika/lims/browser/sample.py   Bika-LIMS(Download)
from AccessControl import getSecurityManager
from DateTime import DateTime
from Products.Archetypes.config import REFERENCE_CATALOG
from Products.Archetypes.public import DisplayList
from Products.CMFCore.utils import getToolByName
    def now(self):
        return DateTime()
 
    def getDefaultSpec(self):
        """ Returns 'lab' or 'client' to set the initial value of the
                self.context.bika_setup.getSamplingWorkflowEnabled()
 
            if not samplingdate > DateTime() and SamplingWorkflowEnabled:
                datesampled = self.ulocalized_time(obj.getDateSampled())
                if not datesampled:
                    (t(_("Hazardous")),
                     self.portal_url)
            if obj.getSamplingDate() > DateTime():
                after_icons += "<img title='%s' " \
                    "src='%s/++resource++bika.lims.images/calendar.png' >" % \
            checkPermission = self.context.portal_membership.checkPermission
            if checkPermission(SampleSample, obj) \
                and not samplingdate > DateTime():
                items[x]['required'] = ['getSampler', 'getDateSampled']
                items[x]['allow_edit'] = ['getSampler', 'getDateSampled']

src/b/i/bika.lims-3.01a/bika/lims/subscribers/samplepartition.py   bika.lims(Download)
from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.WorkflowCore import WorkflowException
from bika.lims.subscribers import skip
from bika.lims.subscribers import doActionFor
 
    elif action_id == "receive":
        instance.setDateReceived(DateTime())
        instance.reindexObject(idxs = ["getDateReceived", ])
        # Transition our analyses
 
    elif action_id == "expire":
        instance.setDateExpired(DateTime())
        instance.reindexObject(idxs = ["review_state", "getDateExpired", ])
 

src/b/i/bika.lims-3.01a/bika/lims/subscribers/sample.py   bika.lims(Download)
from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.WorkflowCore import WorkflowException
from bika.lims.subscribers import skip
from bika.lims.subscribers import doActionFor
    elif action_id == "receive":
 
        instance.setDateReceived(DateTime())
        instance.reindexObject(idxs = ["review_state", "getDateReceived"])
 
 
    elif action_id == "expire":
        instance.setDateExpired(DateTime())
        instance.reindexObject(idxs = ["review_state", "getDateExpired", ])
 

src/h/t/HTPC-Manager-HEAD/libs/sqlobject/col.py   HTPC-Manager(Download)
        TimeType = type(DateTime.Time())
    else: # Zope
        DateTimeType = type(DateTime.DateTime())
        TimeType = type(DateTime.DateTime.Time(DateTime.DateTime()))
 
                return value
            if isinstance(value, datetime.datetime):
                return DateTime.DateTime(value.year, value.month, value.day,
                    value.hour, value.minute, value.second)
            elif isinstance(value, datetime.date):

src/p/r/Products.PloneBooking-3.0.0a2/Products/PloneBooking/DateManager.py   Products.PloneBooking(Download)
from App.class_init import InitializeClass
from AccessControl import ClassSecurityInfo
from DateTime import DateTime
 
 
 
        # Get first day of start year
        date_first_day = DateTime(start_year, 1, 1)
        day_minus = (date_first_day.dow() - 1) % 7
        day_plus = 0
        start_day = (start_week * 7) - 6 - day_minus
        start_date = DateTime(start_year, start_day)
 
        # Get first day of end year
        date_first_day = DateTime(end_year, 1, 1)
        day_minus = (date_first_day.dow() - 1) % 7
        end_day = (end_week * 7) - day_minus + day_plus
        end_date = DateTime(end_year, end_day)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next