View Source z_convert (zotonic_stdlib v1.20.1)
Summary
Functions
Convert to lower case, strip surrounding whitespace.
Convert json from facebook favour to an easy to use format for zotonic templates.
Convert an IP address from a string, IPv4 tuple or IPv6 tuple to the big endian integer representation.
Convert long int to IP address tuple. FIXME: ipv6
Convert (almost) any value to an atom.
Convert (almost) any value to an atom.
Quite loose conversion of values to boolean
Convert values to boolean values according to the Django rules
Convert an input to a date. Input is expected to be YYYY-MM-DD or YYYY/MM/DD.
Convert an input to a (universal) datetime, using to_date/1 and to_time/1. If the input is a string, it is expected to be in iso 8601 format, although it can also handle timestamps without time zones. The time component of the datatime is optional.
Flatten list and convert to string.
Convert (almost) any value to a float.
Convert (almost) any value to an integer.
Convert a datetime (in universal time) to an ISO time string.
Convert an Erlang structure to a format that can be serialized by mochijson.
Convert (almost) any value to a list.
Convert a utc date time to local
Convert an input to a time. Input is expected to be HH:MM:SS or HH.MM.SS.
Convert a local date time to utc
Functions
-spec to_date(z_dateformat:date() | binary() | string() | undefined) -> z_dateformat:date() | undefined.
-spec to_datetime(z_dateformat:datetime() | calendar:date() | binary() | string() | undefined) -> z_dateformat:datetime() | undefined.
-spec to_isotime(z_dateformat:datetime()) -> binary().
-spec to_localtime(z_dateformat:datetime() | undefined) -> z_dateformat:datetime() | undefined.
-spec to_time(calendar:time() | binary() | string() | undefined) -> calendar:time() | undefined.
-spec to_utc(z_dateformat:datetime() | undefined) -> z_dateformat:datetime() | undefined.