labpack/records/time.py
def jsLocal(self, time_zone=''):

        ''' a method to report a javascript string from a labDT object

        :param time_zone: [optional] string with timezone to report in
        :return: string with date and time info
        '''

    # validate inputs
        js_format = '%a %b %d %Y %H:%M:%S GMT%z (%Z)'
        title = 'Timezone input for labDT.jsLocal'
        get_tz = get_localzone()
        if time_zone:
            # if time_zone.lower() in ('utc', 'uct', 'universal', 'zulu'):
            #     raise ValueError('time_zone cannot be UTC. %s requires a local timezone value. Try:\nfor tz in pytz.all_timezones:\n  print tz' % title)
            try:
                get_tz = tz.gettz(time_zone)
            except:
                raise ValueError('\n%s is not a valid timezone format. Try:\nfor tz in pytz.all_timezones:\n  print tz' % title)

    # construct javascript datetime from labDT
        dtLocal = self.astimezone(get_tz)
        return format(dtLocal, js_format)
 a method to report a javascript string from a labDT object

        :param time_zone: [optional] string with timezone to report in
        :return: string with date and time info
        
a method to report a javascript string from a labDT object
a method to report a javascript string from a labDT object
def jsLocal(self, time_zone=''):
        js_format = '%a %b %d %Y %H:%M:%S GMT%z (%Z)'
        title = 'Timezone input for labDT.jsLocal'
        get_tz = get_localzone()
        if time_zone:
            try:
                get_tz = tz.gettz(time_zone)
            except:
                raise ValueError('\n%s is not a valid timezone format. Try:\nfor tz in pytz.all_timezones:\n  print tz' % title)
        dtLocal = self.astimezone(get_tz)
        return format(dtLocal, js_format)
def jsLocal ( self , time_zone = '' ) : js_format = '%a %b %d %Y %H:%M:%S GMT%z (%Z)' title = 'Timezone input for labDT.jsLocal' get_tz = get_localzone ( ) if time_zone : try : get_tz = tz . gettz ( time_zone ) except : raise ValueError ( '\n%s is not a valid timezone format. Try:\nfor tz in pytz.all_timezones:\n  print tz' % title ) dtLocal = self . astimezone ( get_tz ) return format ( dtLocal , js_format )
a method to report a javascript string from a labDT object
a method to report a javascript string from a labDT object
''' a method to report a javascript string from a labDT object

        :param time_zone: [optional] string with timezone to report in
        :return: string with date and time info
        ''' # validate inputs
 # if time_zone.lower() in ('utc', 'uct', 'universal', 'zulu'):
 #     raise ValueError('time_zone cannot be UTC. %s requires a local timezone value. Try:\nfor tz in pytz.all_timezones:\n  print tz' % title)
 # construct javascript datetime from labDT

string with date and time info
string with date and time info
self
time_zone
[optional] string with timezone to report in
[ optional ] string with timezone to report in