(self, args)
DATE: Set the system date offset.
DATE: Set the system date offset.
DATE : Set the system date offset .
def date_(self, args):
        """DATE: Set the system date offset."""
        datestr = values.next_string(args)
        # allowed formats:
        # mm/dd/yy  or mm-dd-yy  mm 0--12 dd 0--31 yy 80--00--77
        # mm/dd/yyyy  or mm-dd-yyyy  yyyy 1980--2099
        now = datetime.datetime.now() + self.time_offset
        strlist = datestr.replace(b'/', b'-').split(b'-')
        if len(strlist) != 3:
            raise error.BASICError(error.IFC)
        try:
            datelist = [int(s) for s in strlist]
        except ValueError:
            raise error.BASICError(error.IFC)
        if (
                datelist[0] > 12 or datelist[1] > 31 or
                (datelist[2] > 77 and datelist[2] < 80) or
                (datelist[2] > 99 and datelist[2] < 1980 or datelist[2] > 2099)
            ):
            raise error.BASICError(error.IFC)
        if datelist[2] <= 77:
            datelist[2] = 2000 + datelist[2]
        elif datelist[2] < 100 and datelist[2] > 79:
            datelist[2] = 1900 + datelist[2]
        try:
            newtime = datetime.datetime(
                datelist[2], datelist[0], datelist[1],
                now.hour, now.minute, now.second, now.microsecond
            )
        except ValueError:
            raise error.BASICError(error.IFC)
        list(args)
        self.time_offset += newtime - now
def date_ ( self , args ) : datestr = values . next_string ( args ) # allowed formats: # mm/dd/yy  or mm-dd-yy  mm 0--12 dd 0--31 yy 80--00--77 # mm/dd/yyyy  or mm-dd-yyyy  yyyy 1980--2099 now = datetime . datetime . now ( ) + self . time_offset strlist = datestr . replace ( b'/' , b'-' ) . split ( b'-' ) if len ( strlist ) != 3 : raise error . BASICError ( error . IFC ) try : datelist = [ int ( s ) for s in strlist ] except ValueError : raise error . BASICError ( error . IFC ) if ( datelist [ 0 ] > 12 or datelist [ 1 ] > 31 or ( datelist [ 2 ] > 77 and datelist [ 2 ] < 80 ) or ( datelist [ 2 ] > 99 and datelist [ 2 ] < 1980 or datelist [ 2 ] > 2099 ) ) : raise error . BASICError ( error . IFC ) if datelist [ 2 ] <= 77 : datelist [ 2 ] = 2000 + datelist [ 2 ] elif datelist [ 2 ] < 100 and datelist [ 2 ] > 79 : datelist [ 2 ] = 1900 + datelist [ 2 ] try : newtime = datetime . datetime ( datelist [ 2 ] , datelist [ 0 ] , datelist [ 1 ] , now . hour , now . minute , now . second , now . microsecond ) except ValueError : raise error . BASICError ( error . IFC ) list ( args ) self . time_offset += newtime - now