Posts: 858
Threads: 196
Joined: Apr 2005
str="ababababab 12343434 Dec 10 02:13:21 0.00 31.03 4[]acabasdfefa 35345345 1287 xcxc Dec 9 20:10:15 0.00 28.14 3"
How can I extract the dates and convert them to QM format?
Posts: 12,097
Threads: 142
Joined: Dec 2002
str s=
;ababababab 12343434 Dec 10 02:13:21 0.00 31.03 4
;acabasdfefa 35345345 1287 xcxc Dec 9 20:10:15 0.00 28.14 3
ARRAY(str) a
if(!findrx(s "\b(Jan|Dec|othermonths) (\d+) (\d+):(\d+):(\d+)" 0 4 a)) out "failed"
int i
for i 0 a.len
,out "%s, %s, %s, %s, %s, %s" a[0 i] a[1 i] a[2 i] a[3 i] a[4 i] a[5 i]
,;now format as you like
,
Posts: 858
Threads: 196
Joined: Apr 2005
Thanks.
I thought that had a direct way of extracting dates with regex
Posts: 858
Threads: 196
Joined: Apr 2005
How can I convert "10 Ene 2007 12:23:00" -->"10 Jan 2007 12:23:00"? (different time zone.)
Posts: 12,097
Threads: 142
Joined: Dec 2002
s.findreplace("Ene" "Jan" 2)
Posts: 858
Threads: 196
Joined: Apr 2005
What I was looking for is a way to change any time in any time zone.
Posts: 12,097
Threads: 142
Joined: Dec 2002
Convert date format to specified locale, or change hours to specified timezone?
Actually I don't know how to do either but have some ideas.