Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Include timezone info for timestamps in search query - #67

Merged
roback merged 2 commits into
masterfrom
include-timezone-in-timestamps
May 17, 2017
Merged

roback merged 2 commits into
masterfrom
include-timezone-in-timestamps

Conversation

@roback

@roback roback commented May 17, 2017 •

Copy link
Copy Markdown
Member

Make sure the server knows that all timestamps are in UTC. This needs to be fixed in other API clients as well.

Make sure the server knows that all timestamps are in UTC.
roback added a commit to twingly/twingly-search-api-php that referenced this pull request May 17, 2017
Comment thread lib/twingly/search/query.rb Outdated

def format_timestamp_for_query(timestamp)
timestamp.to_time.utc.strftime("%FT%T")
timestamp.to_time.utc.strftime("%FT%TZ")

@dentarg dentarg May 17, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using #iso8601 instead?

$ irb -rtime
irb(main):001:0> Time.now.to_time
=> 2017-05-17 16:31:18 +0200
irb(main):002:0> Time.now.to_time.utc
=> 2017-05-17 14:31:20 UTC
irb(main):003:0> Time.now.to_time.utc.strftime("%FT%TZ")
=> "2017-05-17T14:31:47Z"
irb(main):004:0> Time.now.to_time.utc.iso8601
=> "2017-05-17T14:31:53Z"

@roback roback May 17, 2017 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I forgot that this existed :)

@dentarg dentarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@roback
roback merged commit ff24a40 into master May 17, 2017
@roback
roback deleted the include-timezone-in-timestamps branch May 17, 2017 15:05
roback added a commit that referenced this pull request May 17, 2017
* Include timezone info in query (#67)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants