pub enum DateMethod {
Show 30 variants
Add,
Sub,
Set,
Format,
StartOf,
EndOf,
Diff,
Tz,
IsSame,
IsBefore,
IsAfter,
IsSameOrBefore,
IsSameOrAfter,
Second,
Minute,
Hour,
Day,
DayOfYear,
Week,
Weekday,
Month,
Quarter,
Year,
Timestamp,
OffsetName,
IsValid,
IsYesterday,
IsToday,
IsTomorrow,
IsLeapYear,
}
Expand description
日期方法枚举
定义了所有可用的日期操作方法
Variants§
Add
日期加法:向日期添加时间间隔
Sub
日期减法:从日期减去时间间隔
Set
设置日期组件:设置年、月、日等特定组件
Format
格式化:将日期格式化为字符串
StartOf
开始时间:获取某个时间单位的开始时间(如月初、年初)
EndOf
结束时间:获取某个时间单位的结束时间(如月末、年末)
Diff
时间差:计算两个日期之间的差值
Tz
时区转换:将日期转换到指定时区
IsSame
相同判断:检查两个日期是否相同
IsBefore
早于判断:检查第一个日期是否早于第二个日期
IsAfter
晚于判断:检查第一个日期是否晚于第二个日期
IsSameOrBefore
相同或早于:检查第一个日期是否相同或早于第二个日期
IsSameOrAfter
相同或晚于:检查第一个日期是否相同或晚于第二个日期
Second
秒:获取日期的秒数
Minute
分钟:获取日期的分钟数
Hour
小时:获取日期的小时数
Day
日:获取日期的天数
DayOfYear
年中的天:获取日期在一年中的第几天
Week
周:获取日期在一年中的第几周
Weekday
星期几:获取日期是星期几
Month
月:获取日期的月份
Quarter
季度:获取日期所在的季度
Year
年:获取日期的年份
Timestamp
时间戳:获取日期的Unix时间戳
OffsetName
时区名称:获取日期的时区名称
IsValid
有效性检查:检查日期是否有效
IsYesterday
昨天判断:检查日期是否为昨天
IsToday
今天判断:检查日期是否为今天
IsTomorrow
明天判断:检查日期是否为明天
IsLeapYear
闰年判断:检查日期所在年份是否为闰年
Trait Implementations§
Source§impl Clone for DateMethod
impl Clone for DateMethod
Source§fn clone(&self) -> DateMethod
fn clone(&self) -> DateMethod
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DateMethod
impl Debug for DateMethod
Source§impl Display for DateMethod
impl Display for DateMethod
Source§impl<'_derivative_strum> From<&'_derivative_strum DateMethod> for &'static str
impl<'_derivative_strum> From<&'_derivative_strum DateMethod> for &'static str
Source§fn from(x: &'_derivative_strum DateMethod) -> &'static str
fn from(x: &'_derivative_strum DateMethod) -> &'static str
Converts to this type from the input type.
Source§impl From<&DateMethod> for Rc<dyn FunctionDefinition>
impl From<&DateMethod> for Rc<dyn FunctionDefinition>
Source§fn from(value: &DateMethod) -> Self
fn from(value: &DateMethod) -> Self
将日期方法枚举转换为函数定义
为每个日期方法创建相应的函数定义,包括函数签名和实现
Source§impl From<DateMethod> for &'static str
impl From<DateMethod> for &'static str
Source§fn from(x: DateMethod) -> &'static str
fn from(x: DateMethod) -> &'static str
Converts to this type from the input type.
Source§impl FromStr for DateMethod
impl FromStr for DateMethod
Source§impl Hash for DateMethod
impl Hash for DateMethod
Source§impl IntoEnumIterator for DateMethod
impl IntoEnumIterator for DateMethod
Source§impl PartialEq for DateMethod
impl PartialEq for DateMethod
Source§impl TryFrom<&str> for DateMethod
impl TryFrom<&str> for DateMethod
impl Copy for DateMethod
impl Eq for DateMethod
impl IsEnabled for DateMethod
impl StructuralPartialEq for DateMethod
Auto Trait Implementations§
impl Freeze for DateMethod
impl RefUnwindSafe for DateMethod
impl Send for DateMethod
impl Sync for DateMethod
impl Unpin for DateMethod
impl UnwindSafe for DateMethod
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
Mutably borrows from an owned value. Read more