From: Benjamin S. <sch...@pr...> - 2010-10-02 14:05:44
|
Trying to execute the following code works under c-python but fails under jython: import datetime datetime.datetime.strptime("2010-07-05T09:20:24Z","%Y-%m-%dT%H:%M:%SZ") results under Jython 2.5.2b1 (Release_2_5_2beta1:7075, Jun 28 2010, 07:44:20): Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/jython2.5.2b1/Lib/datetime.py", line 1499, in strptime return cls(*(_time.strptime(date_string, format))[0:6]) at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:783) at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:576) at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:501) at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:476) at org.python.modules.time.Time.strptime(Time.java:707) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Unterminated quote results under Python 2.6.4 (r264:75706, Jun 16 2010, 19:34:45): datetime.datetime(2010, 7, 5, 9, 20, 24) Did I get something wrong? -- Ben |