sealed
class
TimeOnly
Time as it would be read from a clock.
public
TimeOnly
.Constructor(
int
hour
=
null
,
int
minute
=
null
,
double
second
=
null
)
public
DatePrecisions
TimeOnly
.Precision
The amount of precision in the date
public
double
TimeOnly
.Second
Returns the seconds as a real number
public
int
TimeOnly
.Ticks
Returns the number of 100 nanoseconds in the time
public
TimeOnly
TimeOnly
.WithPrecision(
DatePrecisions
precision
)
A new object at the specified precision
public
int
TimeOnly
.Hour
Returns the hour
public
int
TimeOnly
.Minute
Returns the minute
public
double
TimeOnly
.Second
Returns the seconds as a real number
public
static
TimeOnly
TimeOnly
.Now(
DatePrecisions
precision
=
null
)
The current time
public
virtual
object
.GetLayoutTip
Return a layout for the hint popup
public
virtual
object
.GetLayoutSpan
Return a layout inside a span
public
virtual
object
.GetLayoutBlock
Return a layout inside a block
public
virtual
object
.GetSourceReference
Return a source reference for this object
public
virtual
void
object
.GetTexSource(
source
)
LaTeX source code for this object
public
virtual
Icon
object
.GetIcon
Return a icon for this object
public
virtual
int
object
.Compare(
value
)
Compares this object with another and returns (-1, 0, or 1)
Example 1
Example
=
Paragraph
{
"The current time is "
;
TimeOnly
.
Now
;
};
The current time is 20:42:48.732609
Example 2
Example2
=
Block
{
var
now
=
TimeOnly
.
Now
;
var
formats
=
[
"o"
,
"r"
,
"t"
,
"T"
,
"HH:mm"
,
"HH:mm:ss"
,
"HH:mm:ss.fff"
,
];
NytrilStyle
.
Heading3
{
"Format Examples"
;
};
Table
(0.5,
PadLR
(3), [
Column
.
Fit
(2"), 3"]) {
Row
{
Background
:
NytrilPalette
.
TableTitleBack
;
TextColor
:
NytrilPalette
.
TableTitleFore
;
"Formatter"
;
"Output"
;
};
foreach
(
var
format
in
formats
) {
NytrilStyle
.
ListRow
(
each0
) {
format
;
Span
{
TextFormat
:
format
;
now
;
};
}
}
}
};
Format Examples
Formatter
Output
o
20:42:48.7326313
r
20:42:48
t
8:42 PM
T
8:42:48 PM
HH:mm
20:42
HH:mm:ss
20:42:48
HH:mm:ss.fff
20:42:48.732