I parse several dates from different sources, I need these dates to be exact (time and hours). The problem is that when I transform this string to a datetime object, it's behind 3 hours.
I tried using timezone GMT-3, UYT, America/Montevideo and still get the same 3 hour-behind dates.
Hello, I'm having a problem when I parse dates on the cloud.
I use 'America/Montevideo' tz, and dates have 3 hour differences on the cloud. When I run locally I get correct dates.
0 Votes
nestor posted about 7 years ago Admin Best Answer
Please have a look at https://dateparser.readthedocs.io/en/latest/#timezone-and-utc-offset, there's a setting TO_TIMEZONE and other methods of converting timezone.
0 Votes
9 Comments
nestor posted about 7 years ago Admin
You're welcome
0 Votes
Diego Estela posted about 7 years ago
Yes, it worked using TO_TIMEZONE property.
Thanks nestor.
0 Votes
nestor posted about 7 years ago Admin Answer
Please have a look at https://dateparser.readthedocs.io/en/latest/#timezone-and-utc-offset, there's a setting TO_TIMEZONE and other methods of converting timezone.
0 Votes
Diego Estela posted about 7 years ago
Thanks for the help nestor.
I am already using that library, in my code I have something like this:
I use it in a serializer method (I also declared the serializer in the Item field)
0 Votes
nestor posted about 7 years ago Admin
Seems like you're subtracting 3:00 from the date. You should probably use a library like dateparser (https://dateparser.readthedocs.io/en/latest/) to convert the dates.
0 Votes
Diego Estela posted about 7 years ago
I parse several dates from different sources, I need these dates to be exact (time and hours). The problem is that when I transform this string to a datetime object, it's behind 3 hours.
I tried using timezone GMT-3, UYT, America/Montevideo and still get the same 3 hour-behind dates.
0 Votes
nestor posted about 7 years ago Admin
Could you explain the problem?
0 Votes
Diego Estela posted about 7 years ago
It happens the same if I use GMT-3
0 Votes
nestor posted about 7 years ago Admin
Scrapy Cloud is in UTC/GMT.
0 Votes
Login to post a comment