Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse method does not allow specifying timezone #72

Open
victorhooi opened this issue Aug 19, 2015 · 8 comments
Open

parse method does not allow specifying timezone #72

victorhooi opened this issue Aug 19, 2015 · 8 comments

Comments

@victorhooi
Copy link

It would be useful if the parse method allowed specifying a timezone.

For example, I'm trying to parse datetime strings from iostat output. They look like this:

08/18/15 16:51:36

Note that there is no timezone information specified. However, I know the timezone based on the timezone of the host system.

Hence, it would be nice if I could use Delorean's parse method, whilst also specifying a timezone. For example:

Delorean.parse('08/18/15 16:51:36', timezone='US/Pacific')
@mlew
Copy link
Collaborator

mlew commented Aug 19, 2015

This seems like a good request. How would you want to handle the case where an offset/timezone is provided in the parse string and as an argument? For example:

delorean.parse('08/18/15 16:51:36 -0800', timezone='US/Pacific')

It seems like the timezone parameter should override whatever is in the string. Thoughts?

@victorhooi
Copy link
Author

I agree, any passed in parameter should override the timezone in the parsed string. (One possible use case is if you are taking the string to parse from somewhere else, and you want to override the timezone).

mlew added a commit to mlew/delorean that referenced this issue Aug 21, 2015
@mlew
Copy link
Collaborator

mlew commented Aug 21, 2015

I've got a working fix for this in a branch I think will be released as 0.6.0.

@myusuf3
Copy link
Owner

myusuf3 commented Aug 21, 2015

@mlew I will be taking a look at it tonight.

@dhararon
Copy link

[Solved]
I have had to upgrade from github "sudo pip install git+git://github.com/myusuf3/delorean.git -U" because on pip repository the last version is 0.5.0

Hi @myusuf3
First Deloeran is an awesome tool but i have a problem with parse method currently im using the version Delorean==0.5.0 and parse method doesn't allow set the timezone yet.

This Exception is show it:
TypeError: parse() got an unexpected keyword argument 'timezone'

I have to upgrade from github ?? or from pip because in the master branch i can see the change.

@mlew
Copy link
Collaborator

mlew commented Nov 12, 2015

Looks like 0.6 hasn't been uploaded to cheeseshop. @myusurf3, can you take
care of that?

On Thu, Nov 12, 2015 at 8:49 AM, Dharwin Perez [email protected]
wrote:

Hi @myusuf3 https://github.com/myusuf3
First Deloeran is an awesome tool but i have a problem with parse method
currently im using the version Delorean==0.5.0 and parse method doesn't
allow set the timezone yet.

This Exception is show it:
TypeError: parse() got an unexpected keyword argument 'timezone'

I have to upgrade from github ?? or from pip because in the master branch
i can see the change.


Reply to this email directly or view it on GitHub
#72 (comment).

@myusuf3
Copy link
Owner

myusuf3 commented Nov 12, 2015

@mlew yeah where there some breaking api changes in 0.6? I was waiting to chat with you! I can release if there are no breaking changes.

@dhararon give a second to sort this out! If there are no breaking changes i will cut a release.

@myusuf3
Copy link
Owner

myusuf3 commented Nov 18, 2015

@mlew lets double check docs when you get a chance i want to cut a release, you think its stable enough to cut 1.0. Lets chat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants