GetAsNumber(GetAsTimestamp ( " 19/05/2015 16:40:24" )) which will give you 63567650424which is a number of seconds between your timestamp and 1/1/0001 12AM. Internally FileMaker stores dates and times as numbers, this helps calculations and displaying different formats
If you need a different format, like the UNIX timestamp, you will need to adjust the number of seconds accordingly.
thankyou for your input 8-)
so basically where you have " 19/05/2015 16:40:24" this will be the time stamp created by filemaker as of that moment I press my button etc.. and the getasnumber command will work from that date/time set in the time stamp field from "1/1/0001 12AM". so every number calculated will be unique and increasing in value each time?
That's correct. Instead of GetAsTimestamp ( " 19/05/2015 16:40:24" ) you can use Get(CurrentTimestamp)
Full calc would be GetAsNumber(Get (CurrentTimestamp))
This way you do not need to construct the timestamp yourself.
The number is going to be unique, unless user manages to press button twice in a second. If it is a problem, just add one second pause to your script.
If you set a number field to the value of Get ( CurrentTimestamp ), you don't even need GetAsNumber to get the numeric value. Note that if you want to use this as a primary key, an auto-entered serial number is simpler to implement and get ( UUID ) is also a better option.
If you have multiple users all creating new records at the same time, it's quite possible for two records to get exactly the same time stamp, but a serial number
ofOR UUID will still be unique.
Hi Nicolai and PhilMod
bother great answers and solutions, thankyou.