Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Extracting date and time from 'timestamp'

Featured Replies

Hi

I would like to extract date and time from a timestamp field.

Are there any more 'elegant' methods than using left/right/middle string functions?

Thansk for interest and suggestions

For time use

GetAsTime ( RightWords ( GetAsText ( TS ) ; 1 ) )

For date use

GetAsDate ( GetAsText ( LeftWords ( TS ; 1 ) ) )

TS is the timestamp field

GetAsDate ( TimeStamp Field )

and

GetAsTime ( TimeStamp Field )

  • Author

Thanks for advices. Both methods work fine.

My problem was, however, due to an improper format of the imported timestamp field.

I have one further question. Does 'GetAsDate' read the date only from DDMMYY-format timestamp? (It seems so).

In my solution I import data which contains a timestamp field formated MMDDYY. I have already written a calculation formula converting the date to DDMMYY format. But perhaps it is possible to read it 'natively'?

Regards

Tomek

Filemaker's native date is a serial number. To display the date, Filemaker uses the date format of the operating system.

The GetAsDate() function works in the opposite direction. It takes text and tries to convert it into a valid Filemaker date. This will only work if the text is a date formatted in the date format of the operating system.

MMDDYY is NOT a date or timestamp - it is text. Unless your operating system is set to use MMDDYY as its date format, GetAsDate ( MMDDYY ) will not work.

If your imported data has a text field in the format MMDDYY, and your operating system date format is DD/MM/YY (note the separator!), then you can use the calc (result is Date) =

GetAsDate (

Middle ( text ; 3 ; 2 ) & "/" &

Left ( text ; 2 ) & "/" &

Right ( text ; 2 )

)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.