You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Making some testing with DateTime I got this results:
>>> from DateTime import DateTime
>>> from datetime import datetime
>>> # Creating DateTime w/o param sets GMT
>>> DateTime()
DateTime('2019/04/29 10:24:50.212822 GMT+2')
>>> # Creating DateTime with string does not set GMT (I guess we need to pass the GMT as part of the string)
>>> DateTime('2019-04-29 10:00')
DateTime('2019/04/29 10:00:00 GMT+0')
>>> # Creating DateTime with datetime instance sets GMT
>>> DateTime(datetime.strptime('2019-04-29 10:00:00', '%Y-%m-%d %H:%M:%S'))
DateTime('2019/04/29 10:00:00 GMT+2')
So my workaround was this:
# Need to import datetime
if self.effectiveDate and hasattr(obj, 'effective_date'):
self.effectiveDate = datetime.strptime(self.effectiveDate, '%Y-%m-%d %H:%M')
obj.effective_date = DateTime(self.effectiveDate)
The same applies to expiration date
The text was updated successfully, but these errors were encountered:
BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)
What I did:
What I expect to happen:
Step 2 and 3 should set the date the same way
What actually happened:
Step 2 saves the timezone. Step 3 does not.
What version of Plone/ Addons I am using:
Clean installation
Plone 5.1.4 (5114)
CMF 2.2.12
Zope 2.13.27
Python 2.7.14
PIL 5.3.0 (Pillow)
More info:
Starting the client in debug mode:
Step 2 output:
Step 3 output
Making some testing with DateTime I got this results:
So my workaround was this:
The same applies to expiration date
The text was updated successfully, but these errors were encountered: