Atom - ŒT
- Format Time
Tags: miscellaneous , string , vectorize
Arity: monadic
This atom is monadic, which means it takes one argument.
Functionality
Format the current time; if the last three bits of z
are abc
, include the hour if a
is true, the minute if b
is true, and the second if c
is true.
Details
The time is returned in 24-hour time joined on colons. The following lookup table indicates the formatting (based on the last three bits, or the number % 8
):
Number | Bit Representation | Format |
---|---|---|
0 | 000 |
|
1 | 001 | SS |
2 | 010 | MM |
3 | 011 | MM:SS |
4 | 100 | HH |
5 | 101 | HH:SS |
6 | 110 | HH:MM |
7 | 111 | HH:MM:SS |