public class SnowflakeDateTimeFormat extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SnowflakeDateTimeFormat.ElementType |
static interface |
SnowflakeDateTimeFormat.ParserGSInteractions
Interface used by the parser for GS interactions, including configurations
and usage tracking.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
ANY_TYPE |
static int |
DATE |
boolean |
epochAutoScale
Enables auto-scaling of Epoch time
|
static int |
TIME |
static int |
TIMESTAMP |
| Modifier and Type | Method and Description |
|---|---|
static String |
effectiveSpecializedTimestampFormat(String specialized,
String generic)
Returns effective String format for TIMESTAMP_*_OUTPUT_FORMAT, assuming
that if the specialized format is empty, the generic format should be used.
|
String |
format(Date date,
String timeZoneId) |
String |
format(Date date,
TimeZone timeZone) |
String |
format(SFTime sfTime,
int scale) |
String |
format(Timestamp timestamp,
String timeZoneId,
int scale) |
String |
format(Timestamp timestamp,
TimeZone timeZone,
int scale) |
static SnowflakeDateTimeFormat |
fromSqlFormat(String sqlFormat) |
String |
getSqlFormat() |
SFTimestamp |
parse(String stringToParse) |
SFTimestamp |
parse(String stringToParse,
TimeZone timeZone,
int centuryBoundary,
boolean ignoreTimezone) |
SFTimestamp |
parse(String stringToParse,
TimeZone timeZone,
int centuryBoundary,
int formatType,
boolean ignoreTimezone,
SnowflakeDateTimeFormat.ParserGSInteractions gsInteractions)
Parses a string into an SFTimestamp.
|
String |
toSimpleDateTimePattern() |
public boolean epochAutoScale
public static final int DATE
public static final int TIME
public static final int TIMESTAMP
public static final int ANY_TYPE
public static SnowflakeDateTimeFormat fromSqlFormat(String sqlFormat)
public String getSqlFormat()
public final String toSimpleDateTimePattern()
public SFTimestamp parse(String stringToParse, TimeZone timeZone, int centuryBoundary, int formatType, boolean ignoreTimezone, SnowflakeDateTimeFormat.ParserGSInteractions gsInteractions)
stringToParse - String to parse.timeZone - Timezone to use if it's not found in the string.
If null, GMT is used by default.centuryBoundary - If > 0, defines the century boundary.formatType - Type(s) of the format(s) desired for auto parsing.ignoreTimezone - If the string contains a timezone, ignore it.gsInteractions - Object containing configuration and usage tracking
for GS, or null if no special handling is needed.public SFTimestamp parse(String stringToParse, TimeZone timeZone, int centuryBoundary, boolean ignoreTimezone)
public SFTimestamp parse(String stringToParse)
public static String effectiveSpecializedTimestampFormat(String specialized, String generic)
specialized - Specialized format, e.g. TIMESTAMP_NTZ_OUTPUT_FORMATgeneric - Generic format, usually TIMESTAMP_OUTPUT_FORMATCopyright © 2020. All rights reserved.