public class SasTemporalFormatter extends Object
This class is not thread-safe and it should be synchronised externally. Actually, it is not a problem for the the Parso itself as it is a single-threaded library, where each instance of SasFileParser has it's own instance of the formatter.
| Constructor and Description |
|---|
SasTemporalFormatter() |
| Modifier and Type | Method and Description |
|---|---|
Object |
formatSasDate(Double sasDays,
OutputDateType dateFormatType,
String sasFormatName,
int width,
int precision)
Format SAS date in SAS days to one of the specified form.
|
Object |
formatSasDateTime(Double sasSeconds,
OutputDateType dateFormatType,
String sasFormatName,
int width,
int precision)
Format SAS date-time in SAS seconds to one of the specified form.
|
Date |
formatSasSecondsAsJavaDate(double sasSeconds)
Format SAS seconds explicitly into the java Date.
|
Object |
formatSasTime(Double sasSeconds,
OutputDateType dateFormatType,
String sasFormatName,
int width,
int precision)
Format SAS time in SAS seconds to one of the specified form.
|
static boolean |
isDateFormat(String sasFormatName)
Check if the specified SAS format is type of date.
|
static boolean |
isDateTimeFormat(String sasFormatName)
Check if the specified SAS format is type of date-time.
|
static boolean |
isTimeFormat(String sasFormatName)
Check if the specified SAS format is type of time.
|
public Date formatSasSecondsAsJavaDate(double sasSeconds)
sasSeconds - seconds since 1960-01-01public Object formatSasDate(Double sasDays, OutputDateType dateFormatType, String sasFormatName, int width, int precision)
sasDays - days since 1960-01-01dateFormatType - type of output datesasFormatName - date column format namewidth - date column format widthprecision - date column format precisionpublic Object formatSasTime(Double sasSeconds, OutputDateType dateFormatType, String sasFormatName, int width, int precision)
sasSeconds - days since 1960-01-01dateFormatType - type of output datesasFormatName - date column format namewidth - date column format widthprecision - date column format precisionpublic Object formatSasDateTime(Double sasSeconds, OutputDateType dateFormatType, String sasFormatName, int width, int precision)
sasSeconds - seconds since midnightdateFormatType - type of output datesasFormatName - date column format namewidth - date column format widthprecision - date column format precisionpublic static boolean isDateFormat(String sasFormatName)
sasFormatName - SAS format namepublic static boolean isTimeFormat(String sasFormatName)
sasFormatName - SAS format namepublic static boolean isDateTimeFormat(String sasFormatName)
sasFormatName - SAS format nameCopyright © 2021. All rights reserved.