pub enum TsqlStyleCode {
Show 17 variants
Default100 = 100,
UsaDate = 101,
AnsiDate = 102,
BritishDate = 103,
GermanDate = 104,
ItalianDate = 105,
DayMonYear = 106,
MonDayYear = 107,
TimeOnly = 108,
UsaDashes = 110,
JapanDate = 111,
IsoBasic = 112,
TimeWithMs = 114,
OdbcCanonical = 120,
OdbcWithMs = 121,
Iso8601 = 126,
Iso8601Tz = 127,
}Expand description
T-SQL date/time style codes used with CONVERT function.
T-SQL primarily uses numeric style codes for date formatting with CONVERT, rather than format patterns. This provides mappings for common styles.
Variants§
Default100 = 100
Style 100: mon dd yyyy hh:miAM (or PM)
UsaDate = 101
Style 101: mm/dd/yyyy (USA)
AnsiDate = 102
Style 102: yyyy.mm.dd (ANSI)
BritishDate = 103
Style 103: dd/mm/yyyy (British/French)
GermanDate = 104
Style 104: dd.mm.yyyy (German)
ItalianDate = 105
Style 105: dd-mm-yyyy (Italian)
DayMonYear = 106
Style 106: dd mon yyyy
MonDayYear = 107
Style 107: Mon dd, yyyy
TimeOnly = 108
Style 108: hh:mi:ss
UsaDashes = 110
Style 110: mm-dd-yyyy (USA with dashes)
JapanDate = 111
Style 111: yyyy/mm/dd (Japan)
IsoBasic = 112
Style 112: yyyymmdd (ISO basic)
TimeWithMs = 114
Style 114: hh:mi:ss:mmm
OdbcCanonical = 120
Style 120: yyyy-mm-dd hh:mi:ss (ODBC canonical)
OdbcWithMs = 121
Style 121: yyyy-mm-dd hh:mi:ss.mmm (ODBC with milliseconds)
Iso8601 = 126
Style 126: yyyy-mm-ddThh:mi:ss.mmm (ISO8601)
Iso8601Tz = 127
Style 127: yyyy-mm-ddThh:mi:ss.mmmZ (ISO8601 with timezone)
Implementations§
Source§impl TsqlStyleCode
impl TsqlStyleCode
Sourcepub fn to_format_pattern(&self) -> &'static str
pub fn to_format_pattern(&self) -> &'static str
Get the equivalent format pattern for a T-SQL style code.
Returns the pattern in strftime style for use in other dialects.
Trait Implementations§
Source§impl Clone for TsqlStyleCode
impl Clone for TsqlStyleCode
Source§fn clone(&self) -> TsqlStyleCode
fn clone(&self) -> TsqlStyleCode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more