
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
ActiveSupport::TimeZone
class defines almost every method you need to handle time.
Thus providing you with convenient means (Time.zone.now
, Time.zone.parse(str)
, etc.) to get time in current time zone.
When you get time string from an external service and parse
can't handle it you need to use strptime
method.
But ActiveSupport doesn't define strptime
method. Let's add this method that will do timezone magic for you.
Add this line to your application's Gemfile:
gem 'time_zone_ext'
And then execute:
$ bundle
Or install it yourself as:
$ gem install time_zone_ext
If you parse time string that already includes timezone information Time.zone.strptime
will return this time in current timezone.
Time.zone = 'EST'
Time.zone.strptime("2012-06-02 00:00 UTC", "%Y-%m-%d %H:%M %Z")
# => Fri, 01 Jun 2012 19:00:00 EST -05:00
If you parse string without explicitly specified timezone, it will be treated as defined in current timezone.
Time.zone = 'EST'
Time.zone.strptime("2012-06-02 00:00", "%Y-%m-%d %H:%M")
# => Sat, 02 Jun 2012 00:00:00 EST -05:00
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)Copyright (c) 2012 Alexander Danilenko. See LICENSE.txt for further details.
FAQs
Unknown package
We found that time_zone_ext demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.