dysong3 Posted April 12, 2012 Posted April 12, 2012 I need to export text that shows date and time in the format : "yyyy-mm-dd hh:mm:ss" The best formula I have found so far for the calculation field is "Year ( DateStart ) & "-" & Month ( DateStart ) & "-" & Day ( DateStart )& " " & TimeStart" However this gives results like ""2012-4-23 10:00:00" which has the problem of the month only having one digit when I need it to have two. Any ideas for resolving this? I also have the problem that the exported text should have a UNIX LF end of carriage instead of a Macintosh end of line. Can you implement a UNIX LF end of carriage from within FMP?
Vaughan Posted April 12, 2012 Posted April 12, 2012 Use this expression to add leading zeros... Right( "00" & Month( DateStart ) ; 2 )
Lee Smith Posted April 12, 2012 Posted April 12, 2012 Let ( [ Date = YourDate ; y = Year ( Date ) ; m = Right ( 0 & Month ( Date ) ; 2 ) ; d = Right ( 0 & Day ( Date ) ; 2 ) ] ; y & "-" & m & "-" & d )
dysong3 Posted April 13, 2012 Author Posted April 13, 2012 Great thanks very much to both of you. Any ideas about the LF end of carriage problem ?
Vaughan Posted April 13, 2012 Posted April 13, 2012 When exporting data (suit the Export script step) there is an option to choose Macintosh or Windows format.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now