Formatting options for Decimal, Time, Date, and Timestamp data types
When you read data from or write data to File connector that is of the Decimal data type, you can use the OSH schema format or the DecimalFormat Java class format. When the data is of the Time, Date, or Timestamp data types, you can use the OSH schema format or the SimpleDateFormat Java class format.
You can specify strings that define the format for fields of these data types in the .osh schema file or in the stage properties.
Time, Date, and Timestamp formatting options
If you use the SimpleDateFormat Java
class format, add the letter J as the prefix for the
format string. For example, the following strings define the same
format:
- String for the SimpleDateFormat Java class format
- Jyyyy-MM-dd HH:mm-ss
- String for the OSH schema format
- %yyyy-%mm-%dd %hh-%nn-%ss
The following table shows the format
strings from the OSH schema that are not supported.
Data type | Format string | Description |
---|---|---|
Date | %NNNNyy | Cutoff year followed by year of the century |
Date | %e | Integer in the range 1 - 7 representing the day of the week, beginning with Sunday |
Date | %E | Integer in the range 1 - 7 representing the day of the week, beginning with Monday |
Time | %SSSSSS | Microseconds |
Time and Date | +N, -N | Option to left or right justify day or month names |