def convertPythonValueToPromptoValue(self, context, value, returnType): if isinstance(value, datetime): from prompto.value.DateTimeValue import DateTimeValue return DateTimeValue(value) else: return super().convertPythonValueToPromptoValue( context, value, returnType) # TODO for now
def plusTime(self, time): dt = datetime(self.value.year, self.value.month, self.value.day, time.value.hour, time.value.minute, time.value.second, time.value.microsecond // 1000) from prompto.value.DateTimeValue import DateTimeValue return DateTimeValue(dt)
def __init__(self, text): dt = DateTimeValue.Parse(text[1:-1]) super(DateTimeLiteral, self).__init__(text, dt)