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

Question: what is the format in which ti stores time? #4

Open
xfim opened this issue Jan 9, 2017 · 4 comments
Open

Question: what is the format in which ti stores time? #4

xfim opened this issue Jan 9, 2017 · 4 comments

Comments

@xfim
Copy link

xfim commented Jan 9, 2017

I am asking because sometimes I need to edit by hand the file because I have forgotten to start or stop 'ti'. But it turns out that the time stored in the file is one hour before my current time. Therefore, I would like first to ask what is the format in which ti stores the data, and second whether it can be done so in a way that uses the date the user is "living", to avoid having to make translations when editing the file by hand.

Thank you.

@willvieira
Copy link

Hi @xfim, where exactly did you find the JSON file? I'm trying to see the stored data but can't find the repository this file is generated. Thanks!

@xfim
Copy link
Author

xfim commented Feb 22, 2017

I have it in $HOME/.ti-sheet

@rveeblefetzer
Copy link

@xfim I believe it's stored simply as a string, but comes from a datetime object using UTC. line 336 is now = datetime.utcnow()

The pytz library could be added to do timezone conversions; I think this would be trivial to make your own installed version overwrite the time/timezone, but @tbekolay would have to weigh in whether it should be added as a menu option

@max-l
Copy link

max-l commented Nov 23, 2017

I occasionaly have to edit the json file and it's a pain everytime it (I'm in a -6 timezone).
@tbekolay or others, are there any advantages in storing datetimes in UTC ?
The only use case I can think of where it is prefferable to store times in UTC would be someone
(a traveler) working in different timezones AND moving the json file between computers that are configured for each timezones.

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