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.

Converting Text to Date

Featured Replies

I am trying to convert text to date using GetAsDate function

I referred to an old answer on below link: But I couldn't get it working , my system's date format is 2016-01-05 and I used the syntax: 

GetAsDate ( Right ( date_start_printing_text;4 ) & "-" & Left ( date_start_printing_text;3 )  &  "-" &  Middle ( date_start_printing_text ; 5 ; 2 ) ) to convert the value format 01-05-2016 

date_start_printing_text is a calculation field, returns text value,  which calculates its value from a text field with timestamp value using Left function

Left ( timestamp_printing ; Position ( timestamp_printing ; " " ; 1 ; 1 )) 

 

Edited by dav1089

Well, if you look at the string you are trying to convert to date  - i.e. the result of =

Right ( date_start_printing_text;4 ) & "-" & Left ( date_start_printing_text;3 )  &  "-" &  Middle ( date_start_printing_text ; 5 ; 2 )

you will see that when the input is "01-05-2016" the output is "2016-01--5-" - so that's not going to work.

I would also suggest you use the Date() function instead of GetAsDate() - that way the calculation does not depend on the date format being used by your file. Try =

Date (
Left ( date_start_printing_text ; 2 ) ;
Middle ( date_start_printing_text ; 4 ; 2 ) ;
Right ( date_start_printing_text ; 4 )
)

 

--
P.S. Why do you need the date_start_printing_text field? You could extract the date components directly from the original timestamp string.

 

Edited by comment

  • Author

Hi,

It works great .. and I used original timestamp string..  Thank you @comment

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.