You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/StardustDocs/topics/read.md
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,19 +172,23 @@ val df = DataFrame.readCSV(
172
172
173
173
### Work with specific date-time formats
174
174
175
-
When parsing date or date-time columns, you might encounter formats different from the default ISO_LOCAL_DATE_TIME.
175
+
When parsing date or date-time columns, you might encounter formats different from the default `ISO_LOCAL_DATE_TIME`.
176
+
Like:
176
177
177
178
<table>
178
179
<tr><th>date</th></tr>
179
180
<tr><td>13/Jan/23 11:49 AM</td></tr>
180
181
<tr><td>14/Mar/23 5:35 PM</td></tr>
181
182
</table>
182
183
183
-
Because the format here "dd/MMM/yy h:mm a" differs from the default (ISO_LOCAL_DATE_TIME), columns like this may be recognized as simple String values rather than actual date-time columns.
184
+
Because the format here `"dd/MMM/yy h:mm a"` differs from the default (`ISO_LOCAL_DATE_TIME`),
185
+
columns like this may be recognized as simple `String` values rather than actual date-time columns.
184
186
185
-
You can fix this whenever you parse a string-based column (e.g., using readCsv, readTsv, or StringCol.convertTo<>()) by providing a custom date-time pattern. There are two ways to do this:
187
+
You can fix this whenever you [parse](parse.md) a string-based column (e.g., using [`DataFrame.readCSV()`](read.md#read-from-csv),
188
+
[`DataFrame.readTSV()`](read.md#read-from-csv), or [`DataColumn<String>.convertTo<>()`](convert.md)) by providing
189
+
a custom date-time pattern. There are two ways to do this:
186
190
187
-
1) By providing the date-time pattern as raw string to the ParserOptions:
191
+
1) By providing the date-time pattern as raw string to the `ParserOptions` argument:
These two approaches are essentially the same, just specified in different ways.
216
+
The result will be a dataframe with properly parsed `DateTime` columns.
212
217
213
-
> Note: Although these examples focus on reading CSV files, the parse operation can handle any String columns (for instance, readCsv, readTsv, StringCol.convertTo<>(), etc.) and accept a ParserOptions argument to configure locale, null-strings, date-time patterns, and more. For more details on the parse operation, see [`Parse Operation`](parse.md).
218
+
> Note: Although these examples focus on reading CSV files,
219
+
> these `ParserOptions` can be supplied to any `String`-column-handling operation
0 commit comments