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: book/src/date-and-time.md
+11
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,7 @@ The following functions are available for date and time handling:
61
61
-`today() -> DateTime`: Returns the current date at midnight (in the local time).
62
62
-`datetime(input: String) -> DateTime`: Parses a string (date and time) into a `DateTime` object.
63
63
-`date(input: String) -> DateTime`: Parses a string (only date) into a `DateTime` object.
64
+
-`time(input: String) -> DateTime`: Parses a string (only time) into a `DateTime` object.
64
65
-`format_datetime(format: String, dt: DateTime) -> String`: Formats a `DateTime` object as a string. See [this page](https://docs.rs/chrono/latest/chrono/format/strftime/index.html#specifiers) for possible format specifiers.
65
66
-`tz(tz: String) -> Fn[(DateTime) -> DateTime]`: Returns a timezone conversion function, typically used with the conversion operator (`datetime -> tz("Europe/Berlin")`)
66
67
-`local(dt: DateTime) -> DateTime`: Timezone conversion function targeting the users local timezone (`datetime -> local`)
@@ -95,3 +96,13 @@ specified timezone (or the local timezone if no timezone is specified).
0 commit comments