datestring
Formats a date and time as text, in the app's timezone (see `set_timezone`; America/New_York unless set). The format uses PHP's date() letters: d j (day), D l (day name), m n (month), M F (month name), Y y (year), H G h g (hour), i (minute), s (second), a A (am/pm), w N (weekday number), z (day of the year), t (days in the month), L (leap year), W o (ISO week and year), S (st/nd/rd/th), U (the timestamp), e T O P (the zone's name, abbreviation and offset), c r (ISO 8601 and RFC 2822 forms); a backslash keeps the next letter as it is. Both arguments are optional: the format is "m/d/y g:i:sa" unless given, and the time is now. The same on the server and on the device.
Runs on: either side: the compiler places the statement that calls it where the values it uses live.
Format:
datestring([format] [, timestamp])
Parameters:
| Parameter | Type | Description |
|---|---|---|
| format | string |  [Optional]the shape of the text, in date() letters |
| timestamp | number |  [Optional]the UNIX timestamp to format; now unless given |
Returned Value:
| Type | Description |
|---|---|
| string | the formatted date and time |
Examples
due_text = datestring("D, M j", due_at)