INTERACT FORUM
More => Old Versions => JRiver Media Center 22 for Windows => Topic started by: Cmely on January 07, 2017, 08:49:37 am
-
This is a duplicate of my post in MC21 board (http://yabb.jriver.com/interact/index.php/topic,102478.msg753319.html#msg753319), because my problem appear in MC22
I have a problem on my MC with this expression:
formatdate(math(now()-1),dd//MM//yyyy)
is not working for me and I don't know why ?
If I use this to create an expression column in a view, I get no result (empty field). If I use the following expression :
=formatdate(now())
I get the correct result. Do you have any idea why ?
-
I cut and pasted your expression into an expression column in a Panes view and it worked fine here. MC 22.0.43 on Mac.
Brian.
-
I cut and pasted your expression into an expression column in a Panes view and it worked fine here. MC 22.0.43 on Mac.
Brian.
Yes. I'm sure it did, as I just copied also the expression as given by Marko, in his thread about "when in time" expression.
I'm running MC 22.0.52 on PC Win10.
I can't figure why it doesn't work. You can see the result on my screen capture below.
Could it be a conflict between date format in MC (which is in english on my PC) and my system configuration (which is in french) ?
-
Check out the documentation for Math() at
http://wiki.jriver.com/index.php/Miscellaneous_Functions#Math
Special care must be taken with the Math() function and locales that use , (comma) as a decimal separator. Many Media Center fields and the return values from functions may contain comma as the decimal point. Your expressions will need to Replace() these before passing the values to Math(), which always uses dot . as the numeric decimal point.
You need to write the expression like this:
=FormatDate(math(replace(now(), /,, .) -1),dd//MM//yy)
-
Thank you Fridden !!!! :D
You solved my problem !