Update date_time_functions.md

This commit is contained in:
alexey-milovidov 2020-02-03 00:20:56 +03:00 committed by GitHub
parent d564573abe
commit f62629f6a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,22 +64,19 @@ Leap seconds are not accounted for.
## toUnixTimestamp {#to_unix_timestamp}
Converts a date with time to a Unix timestamp.
For DateTime argument: converts value to it's internal numeric representation (Unix Timestamp).
For String argument: parse datetime from string according to the timezone (optional second argument, server timezone is used by default) and returns the corresponding unix timestamp.
**Syntax**
```sql
toUnixTimestamp(datetime[, timezone])
toUnixTimestamp(datetime)
toUnixTimestamp(str, [timezone])
```
**Parameters**
- `datetime` — Date with time. [String](../../data_types/string.md).
- `timezone` — Optional time zone argument. [String](../../data_types/string.md).
**Returned value**
- Returns the number of seconds between the specified date and the Unix epoch (1970-01-01 00:00:00 UTC).
- Returns the unix timestamp.
Type: `UInt32`.