Brian Dunning's FileMaker Custom Functions

ConvertTimeStamp ( unixTimeStamp )

Convert unix timestamp to FMP timestamp

  Average rating: 4.2 (37 votes) Log in to vote

Andy Knasinski   Andy Knasinski
NRG Software, LLC.
http://www.nrgsoft.com

Share on Facebook Share on Twitter

  Sample input:
ConvertTimeStamp ( 1200319114 )
  Sample output:
1/14/2008

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Unix bases its time values on the number of seconds since midnight (00:00:00) on 1 January 1970. FMP bases it's time values on the number of seconds since 1/1/1900.

 

Comments

Thomas Seidler   Thomas Seidler, London
Sep 20, 2010
Timestamp ( Date ( 1 ; 1 ; 1970 ) + _unixTS / 86400 ; Mod ( _unixTS ; 86400 ) )

to convert to FileMaker timestamp (as opposed to date).
 
charity   charity, seattle
Jan 7, 2012
"FMP bases it's time values on the number of seconds since 1/1/1900."

should be year 0001 not 1900.
 
Terry Morse   Terry Morse, Palo Alto, CA USA
Aug 20, 2015
Here's my function that accounts for local time zone offsets:

GetAsTimestamp (
(GetAsNumber (timestamp_unix) )
+ GetAsNumber (Timestamp ("01/01/1970" ; "00:00:00") )
+ GetAsNumber(Get(CurrentTimestamp) )
- Floor( Get (CurrentTimeUTCMilliseconds)/1000 )
)
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.