Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Parse common datetime formats and a custom relative time format into a Pendulum object.
datetime can be many different formats and often we want to express a time relative
to the current time, such as 10 minutes ago
. This module is able to handle all datetime formats
as well as our custom relative time format.
For the current time:
now
Any other time:
(+/-)(integer) (milliseconds|seconds|minutes|days|weeks|months|years)
examples:
now
-1 months
+3 days
-123 seconds
To parse a datetime (not including relative time), you can use the try_parse_dt
function. This
will return a pendulum object
from datetime_parser import try_parse_dt
example = "2020-02-02 10:10:10"
example_obj = try_parse_datetime(example)
To parse a datetime or relative datetime, use is_datetime
.
from datetime_parser import is_datetime
example = "-5 minutes"
example_obj = is_datetime(example)
FAQs
Parse common datetime formats and a custom relative time format into a Pendulum object.
We found that datetime-parser demonstrated a healthy version release cadence and project activity because the last version was released less than 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 News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.