pub struct TimeFn;Expand description
Returns the fractional-day serial for a time built from hour, minute, and second.
TIME normalizes overflowing and negative components by wrapping across day boundaries.
§Remarks
- The result is always in the range
0.0..1.0and represents only a time-of-day fraction. - Values are normalized like Excel (for example,
25hours becomes01:00:00). - Time fractions are date-system independent because they do not include a date component.
§Examples
title: "Create noon"
formula: "=TIME(12, 0, 0)"
expected: 0.5title: "Wrap overflowing hour"
formula: "=TIME(25, 0, 0)"
expected: 0.0416666667related:
- TIMEVALUE
- HOUR
- NOW
faq:
- q: "Can TIME return values greater than 1 day?"
a: "No. TIME wraps overflow and always returns a fraction in [0,1), so extra days are discarded."Trait Implementations§
Source§impl Function for TimeFn
[formualizer-docgen:schema:start]
Name: TIME
Type: TimeFn
Min args: 3
Max args: 3
Variadic: false
Signature: TIME(arg1: number@scalar, arg2: number@scalar, arg3: number@scalar)
Arg schema: arg1{kinds=number,required=true,shape=scalar,by_ref=false,coercion=NumberLenientText,max=None,repeating=None,default=false}; arg2{kinds=number,required=true,shape=scalar,by_ref=false,coercion=NumberLenientText,max=None,repeating=None,default=false}; arg3{kinds=number,required=true,shape=scalar,by_ref=false,coercion=NumberLenientText,max=None,repeating=None,default=false}
Caps: PURE
[formualizer-docgen:schema:end]
impl Function for TimeFn
[formualizer-docgen:schema:start] Name: TIME Type: TimeFn Min args: 3 Max args: 3 Variadic: false Signature: TIME(arg1: number@scalar, arg2: number@scalar, arg3: number@scalar) Arg schema: arg1{kinds=number,required=true,shape=scalar,by_ref=false,coercion=NumberLenientText,max=None,repeating=None,default=false}; arg2{kinds=number,required=true,shape=scalar,by_ref=false,coercion=NumberLenientText,max=None,repeating=None,default=false}; arg3{kinds=number,required=true,shape=scalar,by_ref=false,coercion=NumberLenientText,max=None,repeating=None,default=false} Caps: PURE [formualizer-docgen:schema:end]
fn name(&self) -> &'static str
fn min_args(&self) -> usize
fn arg_schema(&self) -> &'static [ArgSchema]
Source§fn eval<'a, 'b, 'c>(
&self,
args: &'c [ArgumentHandle<'a, 'b>],
_ctx: &dyn FunctionContext<'b>,
) -> Result<CalcValue<'b>, ExcelError>
fn eval<'a, 'b, 'c>( &self, args: &'c [ArgumentHandle<'a, 'b>], _ctx: &dyn FunctionContext<'b>, ) -> Result<CalcValue<'b>, ExcelError>
fn namespace(&self) -> &'static str
fn variadic(&self) -> bool
fn volatile(&self) -> bool
Source§fn aliases(&self) -> &'static [&'static str]
fn aliases(&self) -> &'static [&'static str]
fn function_salt(&self) -> u64
Source§fn eval_reference<'a, 'b, 'c>(
&self,
_args: &'c [ArgumentHandle<'a, 'b>],
_ctx: &dyn FunctionContext<'b>,
) -> Option<Result<ReferenceType, ExcelError>>
fn eval_reference<'a, 'b, 'c>( &self, _args: &'c [ArgumentHandle<'a, 'b>], _ctx: &dyn FunctionContext<'b>, ) -> Option<Result<ReferenceType, ExcelError>>
Source§fn dispatch<'a, 'b, 'c>(
&self,
args: &'c [ArgumentHandle<'a, 'b>],
ctx: &dyn FunctionContext<'b>,
) -> Result<CalcValue<'b>, ExcelError>
fn dispatch<'a, 'b, 'c>( &self, args: &'c [ArgumentHandle<'a, 'b>], ctx: &dyn FunctionContext<'b>, ) -> Result<CalcValue<'b>, ExcelError>
Auto Trait Implementations§
impl Freeze for TimeFn
impl RefUnwindSafe for TimeFn
impl Send for TimeFn
impl Sync for TimeFn
impl Unpin for TimeFn
impl UnsafeUnpin for TimeFn
impl UnwindSafe for TimeFn
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more