Edit

Timestamp ( [zone] [, format])

Result Type: string

Definition: Returns a millisecond-resolution timestamp string. Zone may be TSZ_UTC, or TSZ_Local. Format may be TSF_Default, TSF_ISO8601. By default, the local timezone is used; you may pass TSZ_UTC as a first parameter to get UTC.

Examples: 

TimeStamp() — "2021-10-07 15:23:27.708" same as TimeStamp(TSZ_LOCAL, TSF_Default)

TimeStamp(TSZ_LOCAL, TSF_Default) — "2021-10-07 15:23:27.708"

TimeStamp(TSZ_UTC, TSF_Default) — "2021-10-07 02:23:27.707Z"

TimeStamp(TSZ_UTC, TSF_ISO8601) — "2021-10-07T02:23:27.707Z"

TimeStamp(TSZ_LOCAL, TSF_ISO8601) — "2021-10-07T15:23:27.708"

In v9.1 and later, TimeStamp also supports Unix epoch timestamps using formats TSF_Unix, TSF_Unix_ms, and TSF_Unix_us, or a POSIX strftime format string. On Windows versions prior to 10, millisecond- and microsecond-resolution might be optimistic.

Examples: 

TimeStamp(TSZ_UTC, TSF_Unix) — "1658941040"

TimeStamp(TSZ_UTC, TSF_Unix_ms) — "1658941040.189"

TimeStamp(TSZ_UTC, TSF_Unix_us) — "1658941040.189736"

TimeStamp(TSZ_LOCAL, "%Y-%m-%d %H:%M:%S") — "2022-07-29 10:18:42"

Availability:  available in MoneyWorks 9.0.4 and later; Unix Epoch and strftime format in v9.1 and later. Note that Mac and Windows have differing support for strftime format specifiers; if you're deploying on both platforms, make sure you only use format specifiers that are supported on both platforms.

See Also:

CalcDueDate: Calculate a due date for given terms

CurrentPeriod: Get the current period number

Date: Convert d,m,y to a date

DateToPeriod: Convert a date to a period

DateToText: Format a date as a string

Day: Get the Day of month of a date

DayOfWeek: Get The weekday of a date

FirstUnlockedPeriod: Get the oldest period that is not locked

Month: Get the month of a date

PeriodName: Get the Name of a period

PeriodOffset: Difference between two periods

PeriodToDate: Get the end date of a period

TextToDate: Parse a string to a date

Time: The current Datetime

TimeAdd: Add seconds to a DateTime

TimeDiff: The difference, in seconds, between two DateTimes

Today: Today's date

WeekOfYear: Convert a date to a week number

Year: Year of a date