sql.ts2FMdate ( )

Function stats

Average user rating
37
333
9999
Support
FileMaker 7.0 +
Date posted
04 May 2012
Version
1
Recursive function
No

Author Info
 Fabrice

74 functions

Average Rating 4.4

author_avatar



 

Function overview

Prototype

sql.ts2FMdate  ( _TS )


Parameters

_TS  a sql timestamp like 2012-10-3 10:05:36


Description

Tags:  Timestamp   Sql   Date   Convert  

converts a Timestamp returned by ExecuteSQL function (type text) into a valid FileMaker date.
Result type : date

Examples

Sample input

sql.ts2FMdate( 2012-10-3 10:05:36 )


Sample output

10/3/2012 (USA) or 3/10/2012 (in civilized countries ;))

 

Function code

/* sql.ts2FMdate ( _TS )

by Fabrice Nordmann, 1-more-thing

http://www.1-more-thing.com
http://www.twitter.com/1morethingtweet


converts a Timestamp returned by ExecuteSQL function (type text) into a valid FileMaker date.
Result type : date

Sample :
sql.ts2FMdate( 2012-10-3 10:05:36 ) => 10/3/2012 (USA) or 3/10/2012 (in civilized countries ;))

v1 - May 2012
*/


Case ( _ts ;

Let ( _ts = Substitute ( _TS ; "-" ; " " ) ;
Date ( MiddleWords ( _ts ; 2 ; 1 ) ; MiddleWords ( _ts ; 3 ; 1 ) ; MiddleWords ( _ts ; 1 ; 1 ))
)
)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/333

    Prototype: sql.ts2FMdate( _TS )
    Function Author: Fabrice (http://www.fmfunctions.com/mid/37)
    Last updated: 04 May 2012
    Version: 1

*/
// ===================================

 

 

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (31)
Date  (28)
XML  (26)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Interface  (15)
Layout  (15)
Text  (14)
Variables  (12)
Layout Objects  (11)
Filter  (11)
Design  (10)
Array  (7)