Skip to content

Commit 79665b4

Browse files
committed
small reformatting and rephrasing regarding read docs date-time patterns
1 parent cd56517 commit 79665b4

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

docs/StardustDocs/topics/read.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,23 @@ val df = DataFrame.readCSV(
172172

173173
### Work with specific date-time formats
174174

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:
176177

177178
<table>
178179
<tr><th>date</th></tr>
179180
<tr><td>13/Jan/23 11:49 AM</td></tr>
180181
<tr><td>14/Mar/23 5:35 PM</td></tr>
181182
</table>
182183

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.
184186

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:
186190

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:
188192

189193
<!---FUN readNumbersWithSpecificDateTimePattern-->
190194

@@ -196,7 +200,7 @@ val df = DataFrame.readCSV(
196200
```
197201
<!---END-->
198202

199-
2) By providing a DateTimeFormatter to the ParserOptions:
203+
2) By providing a `DateTimeFormatter` to the `ParserOptions` argument:
200204

201205
<!---FUN readNumbersWithSpecificDateTimeFormatter-->
202206

@@ -209,8 +213,14 @@ val df = DataFrame.readCSV(
209213

210214
<!---END-->
211215
These two approaches are essentially the same, just specified in different ways.
216+
The result will be a dataframe with properly parsed `DateTime` columns.
212217

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
220+
> (like, `readCsv`, `readTsv`, `stringCol.convertTo<>()`, etc.)
221+
> This allows you to configure the locale, null-strings, date-time patterns, and more.
222+
>
223+
> For more details on the parse operation, see the [`parse operation`](parse.md).
214224
215225
## Read from JSON
216226

0 commit comments

Comments
 (0)