Jul 30, 2012; 02:53
Pier Kuipers
Date formatting gotcha
Wow. Haven't posted to the list in about three centuries, but just came
across a little gotcha that I though I should share - since it took me
several hours to track down a strange date-related problem in Lasso 8.5+
(note the "plus").
Consider the following code:
[
local('date_value' = string);
#date_value = (date(#date_value,-format='%d/%m/%Y'))->format('%Q');
output(#date_value);
]
On my deployment server, this returns a faulty date, as in "0001-01-01". On
my laptop, the same code returns "2012-07-30" - today's date, in other
words.
After lots of debugging, I finally discovered the problem: Server is
running 8.5, Laptop is running 8.6.
Putting in an extra conditional to check we actually have a date to begin
with sorts the problem, but I have to say that I find 8.6 behaviour a bit
strange - formatting a non-existent date into today's date?
Oh, and... Hi, fellow Lasso'ers :-)
Cheers
Pier
--
Pier Kuipers
Mobile: +353 87 294 3063
Blog: http://www.pierkuipers.com
Facebook: http://www.facebook.com/pier.kuipers
Twitter: @pkvisualid
AIM: pkvisualid
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Jul 29, 2012; 20:02
Steve Piercy - Web Site Builder
Re: Date formatting gotcha