-
Notifications
You must be signed in to change notification settings - Fork 168
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
Store a timezone #16
Comments
Hi. That's actually a feature that we should be adding shortly. I already On Wed, Dec 23, 2015, 5:02 AM Jeff Abrahamson [email protected]
|
Is the patch stable enough that it could be pushed to a branch for testing/review? |
Hi, Jeff. Sorry for the delay. We're still debating internally about the best way to return this data in the cctz API. We're hesitant to return the raw offset because that encourages bad practices like doing arithmetic with that offset. We're also a little hesitant to return the offset wrapped in a So we are investigating a few other alternatives. We are interested in finding a way to return all the data from the input string (e.g., Thanks for your patience. |
Is this (internal) discussion happening in the light of day? |
The majority of the discussion is happening with respect to Google's internal code and our internal copy of cctz. Those discussions are not externally visible. |
What I was trying to poke you about was suggesting that maybe, in so much as there exists this open source version of cctz, it might be worth posting regular summaries of your conversations on issues, assuming there are reasons not to make the full discussion open. |
I understand. We'll do our best to keep this thread updated. |
Are there any updates here? |
I believe the answer is no. If you want to take a string like "2015-12-23 10:55:09+0100" and extract the "+0100" part, you're on your own. Timezone offsets are not first-class objects in CCTZ (
My answer to the original question would be to not discard information that you later need. That is, if you need the local time, store the local time. |
This may be a question about how to use the library rather than an issue. If so, many thanks for a pointer in the right direction.
I receive strings representing time and then store absolute time (in protobufs as int64):
This works great. From time to time, I need to know local time for the original source. That is, I've received something like
2015-12-23 10:55:09+0100
and stored1450864509
. Now, in another process on another day, I see1450864509
and want to recover10:55
(i.e., for this absolute time, the corresponding local time was 10:55. For a concrete mental image, suppose I'm analysing when events correspond to lunchtime.Of course, I can (outside of cctz) parse out the UTC offset and store that. I could also simply parse out the "HH:MM" string and store that. But those both seem quite wrong, and cctz seems well enough thought through that I'm guessing there's some way I haven't understood to persist an idea of a timezone.
And, if not, I suggest that this would be useful.
The text was updated successfully, but these errors were encountered: