Sep 10, 2003 #1 bist Programmer Sep 10, 2003 1 US I have a string field that says Deadline set to "10.09.2003 09:23 ECT" Can anyone help me with how to take out the date/time and convert it to a datetime-field? Thanks! Britist
I have a string field that says Deadline set to "10.09.2003 09:23 ECT" Can anyone help me with how to take out the date/time and convert it to a datetime-field? Thanks! Britist
Sep 10, 2003 #2 Madawc Programmer Sep 5, 2002 7,628 GB try CDateTime(your.string) Madawc Williams East Anglia, Great Britain Upvote 0 Downvote
Sep 10, 2003 #3 lbass Technical User Feb 9, 2002 32,816 US Something like this might work: stringvar comment := {table.string}; stringvar extractdatetime := mid(comment,instr(comment,'"')+1, instrrev(comment,'"', -1) - instr(comment,'"')-5); cdatetime(replace(extractdatetime,".",","); This also eliminates the "ECT" (which you can't include in the conversion to datetime) so that the result using your example above would be: 10/09/2003 09:23:00AM -LB Upvote 0 Downvote
Something like this might work: stringvar comment := {table.string}; stringvar extractdatetime := mid(comment,instr(comment,'"')+1, instrrev(comment,'"', -1) - instr(comment,'"')-5); cdatetime(replace(extractdatetime,".",","); This also eliminates the "ECT" (which you can't include in the conversion to datetime) so that the result using your example above would be: 10/09/2003 09:23:00AM -LB
Sep 10, 2003 #4 synapsevampire Programmer Mar 23, 2002 20,180 US Or: cdatetime(replace(left({table.field},16),".","/") This eliminates the timezone, if you need to allow for various timezones, you'll need to use a formula or a UFL (milletsoftware.com has a UFL. -k Upvote 0 Downvote
Or: cdatetime(replace(left({table.field},16),".","/") This eliminates the timezone, if you need to allow for various timezones, you'll need to use a formula or a UFL (milletsoftware.com has a UFL. -k