Timestamp()

Category: Timestamp

Syntax: Timestamp ( date; time )

Parameters:

dateAny calendar date or expression that returns a date. The date parameter can also be an integer from 1 to 1460970, representing the number of days since January 1, 0001.

timeAny time value or expression that returns a time value. The time parameter can also be an integer representing the number of seconds since midnight.

Data type returned: Timestamp

Description:

Returns a timestamp from the two parameters in the format "12/12/2005 10:45:00 AM".

You can use text parsing functions or mathematical operations to extract the pieces of a timestamp. You can also use the GetAsDate() and GetAsTime() functions to retrieve just the date or time.

Internally, FileMaker Pro stores timestamp data as the number of seconds since 1/1/0001 12:00 a.m. You can use the GetAsNumber() function to see the numeric representation. For instance, GetAsNumber (Timestamp ("4/18/2004"; 12:00pm)) returns 63217886400.

You can manually calculate the integer value of a timestamp by using the following formula:

(GetAsNumber (myDate)-1) * 86400 + GetAsNumber (myTime)

Examples:

Function

Results

Timestamp ("10/11/2005"; "10:20 AM")

Returns 10/11/2005 10:20 AM.

Timestamp ("10/11/2005"; "20:20:20")

Returns 10/11/2005 8:20:20 PM.

Timestamp (Date (10;11;2005); Time (10;20;00))

Returns 10/11/2005 10:20 AM.

Timestamp (laborDay; 0)

Returns 9/5/2005 12:00:00 AM when laborDay is equal to 9/5/2005.

Timestamp (1; 0)

Returns 1/1/0001 12:00 AM.

Категории