April 9, 201312 yr 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
April 9, 201312 yr 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)
April 9, 201312 yr 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 ).
April 10, 201312 yr Solution 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) )
April 10, 201312 yr Author 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?
April 10, 201312 yr 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)
April 11, 201312 yr 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 )
Create an account or sign in to comment