Search found 15 matches

by soutre
24 Aug 2019 14:48
Forum: User Help / Bug Reports
Topic: manipulate multi lines text
Replies: 7
Views: 16765

Re: manipulate multi lines text

Carriage return is represented by \n in the string. So if you'd like to remove them, try running a replace on it. Give this a try:

Code: Select all

var="a\nb\nc\nd\ne\nf";

log(var);

log(replace(var,"\n",","));
Should look like this:

Code: Select all

a
b
c
d
e
f


a,b,c,d,e,f
by soutre
20 Aug 2019 01:48
Forum: User Help / Bug Reports
Topic: getDate and "{x,dateformat,x}" error
Replies: 6
Views: 15886

Re: getDate and "{x,dateformat,x}" error

That is interesting. I haven't gone that far yet. But surely it will add up to the millis. Automagic has 6 getDate() functions. My favourite 2 are getDate() to show current time and getDate(date, pattern). Actually you can easily convert the date using pattern. d = "2019-08-20"; epoch = getDate(d, ...
by soutre
19 Aug 2019 19:07
Forum: User Help / Bug Reports
Topic: getDate and "{x,dateformat,x}" error
Replies: 6
Views: 15886

Re: getDate and "{x,dateformat,x}" error

So it stores in milliseconds that must be why. The dateFormat is becoming more interesting. Here is the formula I'm using to convert the dates. Using the string "2019-08-20" as an example. Automagic isn't able to format this date either. So first we must convert it into epoch time. Just the time in ...
by soutre
19 Aug 2019 04:52
Forum: User Help / Bug Reports
Topic: getDate and "{x,dateformat,x}" error
Replies: 6
Views: 15886

Re: getDate and "{x,dateformat,x}" error

Looks like I'll be multiplying the value by 10000 to add the 4 extra zeros before formatting. timeA=1566194400*10000; timeB="{timeA,dateformat,hh:mm a}" Not so fast! After testing that, the time was substantially off. And it got me to wonder. The time is missing 4 digits and time zones are also...4 ...
by soutre
18 Aug 2019 23:51
Forum: User Help / Bug Reports
Topic: getDate and "{x,dateformat,x}" error
Replies: 6
Views: 15886

getDate and "{x,dateformat,x}" error

I'm having some trouble to convert a date and time. It seems to either result in an error or the same variable is returned. These two values are the original data examples. Dateformat doesn't work on them. timeA="2019-08-19 06:00:00"; //Regular format timeB="1566194400" //Epoch time However, as I on...