ScottBaxter Posted April 9, 2013 Posted April 9, 2013 Hello, I'm currently writing an XML SOAP Request and it requires the time / date to be formatted in a certain way and I'm just wondering if FileMaker can format it like I require. I require it to be formatted like this: 2013-04-26T10:10:00 I need the T to stay too... Thanks, Scott
doughemi Posted April 9, 2013 Posted April 9, 2013 A calculation: Let( ts = YourTimestampField;//Substitute the name of your timestamp field here Year(ts) & "-" & Month(ts) & "-" & Day(ts) & "T" & Hour(ts) & ":" & Minute(ts) & ":" & Second(ts) ) If you don't have a timestamp field, create one with the calculation Timestamp( Date; Time) 1
David Jondreau Posted April 9, 2013 Posted April 9, 2013 Doug's almost there. I think you want leading zeroes on all the single digit numbers, yes? You'll have to correctly format those by wrapping each in a Right ( 0 & number ; 2 ). 2
Solution doughemi Posted April 10, 2013 Solution Posted April 10, 2013 Good catch, David. Making the formula Let( ts = YourTimestampField;//Substitute the name of your timestamp field here Year(ts) & "-" & Right(0 & Month(ts); 2) & "-" & Right(0 & Day(ts); 2) & "T" & Right(0 &Hour(ts);2) & ":" & Right(0 & Minute(ts);2) & ":" & Right(0 &Second(ts);2) ) 1
ScottBaxter Posted April 10, 2013 Author Posted April 10, 2013 Thanks for the help guys, I'll test this now! :-)
ScottBaxter Posted April 10, 2013 Author Posted April 10, 2013 Hey guys, thanks for the reply... The only problem I've got is the month is missing a 0 for instance. 2013-04-01 and the calculation show 2013-4-01T14:00:00 Is there away I can put a 0 first?
doughemi Posted April 10, 2013 Posted April 10, 2013 Make sure that the highlighted part is copied correctly Year(ts) & "-" & Right(0 & Month(ts); 2) & "-" & Right(0 & Day(ts); 2) & "T" & Right(0 &Hour(ts);2) & ":" & Right(0 & Minute(ts);2) & ":" & Right(0 &Second(ts);2)
Vaughan Posted April 11, 2013 Posted April 11, 2013 The 0 should be in quotes because it is text... it might work the way it is now, but that could change in the future. Right( "0" & Month( ts ) ; 2 )
Recommended Posts
This topic is 4255 days old. Please don't post here. Open a new topic instead.
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