# set_timezone

Definition: | include builtins\timedate.e timedate td = set_timezone(timedate td, string newtz)
Description: | Set the timezone on an un-timezoned timedate.
pwa/p2js: | Supported.
Comments: | If the timedate already has a timezone it is returned unchanged. To forcibly change an existing timezone and adjust the time accordingly, use change_timezone(). For regions with daylight savings, always use the daylight savings code, even when it is out of season. This will create a timedate that has the correct auto-toggling feature when subsequently adjusted using the adjust_timedate() function.
Example: |
    include builtins\timedate.e
    set_timedate_formats({"h:mmpm tz 'on' Dddd, Mmmm dst, yyyy",
                          "h:mmpm 'on' Dddd, Mmmm dst, yyyy"})
    timedate td = parse_date_string("9:00pm on Friday, July 4th, 2015")
    td = set_timezone(td, "BST")
    ?format_timedate(td)
    -- displays "9:00pm BST on Friday, July 4th, 2015")
See Also: | timedate, the timedate type, change_timezone, adjust_timedate, set_timedate_formats, parse_date_string, format_timedate