Socket
Socket
Sign inDemoInstall

midday.ahk

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    midday.ahk

Converts 24-hour (military) time string to 12-hour (meridiem) time string and vice versa.


Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

midday.ahk

Converts 24-hour (military) time string to 12-hour (meridiem) time string and vice versa.

Installation

In a terminal or command line navigated to your project folder:

npm install midday.ahk

In your code only export.ahk needs to be included:

#Include %A_ScriptDir%\node_modules
#Include midday.ahk\export.ahk

midday := new midday()
result := midday.to24("12:30 AM")
; => "00:30"

result := midday.to12("00:30")
; => "12:30 AM"

You may also review or copy the library from ./export.ahk on GitHub; #Incude as you would normally when manually downloading.

API

.to12(value)

Converts 24-hour (military) time string to 12-hour (meridiem) time string.

Arguments

time (String): the time string

Returns

time (String): converted 24-hour time string to 12-hour time

Exception

throws an error if the time string is invalid

midday.to24("12:30 AM")
; => "00:30"

.to24(value)

Converts 12-hour (meridiem) time string to 24-hour (military) time string.

Arguments

time (String): the time string

Returns

time (String): converted 24-hour time string to 12-hour time

Exception

throws an error if the time string is invalid

midday.to12("00:30")
; => "12:30 AM"

midday.to12("0030")
; => "12:30 AM"

Keywords

FAQs

Last updated on 13 Jul 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc