Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
convert-time
Advanced tools
Readme
Convert a string between 12-hour time and 24-hour time with customizable format.
npm install convert-time
var convertTime = require('convert-time');
convertTime('2pm');
// => '14:00'
convertTime('2a.m.');
// => '2:00'
convertTime('15:00');
// => '3:00 pm'
convertTime('2:00', 'HH : mm A');
// => '14 : 00 PM'
If time
is in 12-hour time, convert it to 24-hour time, and vice-versa. Use
format
to customize the output, if provided.
time
is a string representing time in either 12-hour or 24-hour format.
format
is an optional string argument to specify the output format. Acceptable
values are:
hh
- Hour. It can be one or two digits.HH
- Hour. It is always two digits. If one digit, 0
is appended in
the front. (e.g. 3
becomes 03
)mm
- Minute. It can be one or two digits.MM
- Minute. It is always two digits. If one digit, 0
is appended in
the front. (e.g. 9
becomes 09
)a
- Period. am
or pm
.A
- Capitalized period. AM
or PM
.Default values for format are:
hh:MM
for 12-hour to 24-hour conversion.hh:MM a
for 24-hour to 12-hour conversion.MIT
FAQs
Convert 24-hour time to 12-hour time and vice versa
The npm package convert-time receives a total of 138 weekly downloads. As such, convert-time popularity was classified as not popular.
We found that convert-time 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 News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.