This plugin allows for creating a time in RFC2822 format based on an optional unix time and location (time zone).
Follow the instructions in our manual to add our package repository and then run the below command.
apt-get install halon-extras-time-rfc2822
yum install halon-extras-time-rfc2822
These functions needs to be imported from the extras://time-rfc2822
module path.
Create a time in RFC2822 format. An optional unix time can be provided, otherwise the current time will be used. An optional location (time zone) can be provided, otherwise the current location will be used.
Params
- unixtime
number
- The unix time (optional) - location
string
- The location (optional)
Returns
On success it will return a string that contains the time in RFC2822 format. On error an exception will be thrown.
Example
import { time_rfc2822 } from "extras://time-rfc2822";
echo time_rfc2822();
echo time_rfc2822(1645012689.519825);
echo time_rfc2822(time(), "Europe/Stockholm");