Skip to main content

set_timezone

Function set_timezone 

Source
pub fn set_timezone(datetime: impl AsRef<[u8]>) -> Result<String>
Expand description

datetime (any string PHP’s DateTime parses) converted to the default timezone, in the database format.

Fails with the parser’s message when datetime is not a date (Kind::Database, wrapping the Kind::DateMalformedString error).

PHP: DateTime::setTimezone($datetime).