Weird date week error Lasso 9

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Weird date week error Lasso 9

Jolle Carlestam-2
I’m struggling with a weird error that I only get on one machine. I have tested on three different machines all running 9.2 but get different results.

Here’s code:
local(mydate =date('2015-01-07 00:00:00'))
#mydate -> week
'\n'
#mydate
'\n'
date -> week

On my local test machine OSX Mavericks running 9.2.7 I get
2
2015-01-07 00:00:00
2
(Correct)

On a Centos 5 machine running 9.2.5 (I think) I get
2
2015-01-07T00:00:00
2
(Yes, I don’t know what that T does there. But that’s not the problem.)

On the trouble machine, Centos 6 running 9.2.7 I get
1
2015-01-07 00:00:00
1
Here’s my issue. Why does this machine consider the week to be 1? When the correct answer is 2, as given by the other machines.

To add noice to the confusion. If I run this on the CLI on the faulty Centos machine:
lasso9 -s "date -> week”
I get
2
?!? Same machine gives me different answers depending on where I ask. I can confirm that this is not related to a specific instanced. I have three instances running on the machine and the error is there regardless of instance.This has me very confused, and clients irritated since this is a production server.

Any clues out there?

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Weird date week error Lasso 9

Bil Corry-3
Can you loop from December 22 through February 1 and output the week number
for each date?  I'm wondering if it's always 1, or if some pattern emerges.

- Bil

On Wed, Jan 7, 2015 at 10:23 AM, Jolle Carlestam <[hidden email]>
wrote:

> I’m struggling with a weird error that I only get on one machine. I have
> tested on three different machines all running 9.2 but get different
> results.
>
> Here’s code:
> local(mydate =date('2015-01-07 00:00:00'))
> #mydate -> week
> '\n'
> #mydate
> '\n'
> date -> week
>
> On my local test machine OSX Mavericks running 9.2.7 I get
> 2
> 2015-01-07 00:00:00
> 2
> (Correct)
>
> On a Centos 5 machine running 9.2.5 (I think) I get
> 2
> 2015-01-07T00:00:00
> 2
> (Yes, I don’t know what that T does there. But that’s not the problem.)
>
> On the trouble machine, Centos 6 running 9.2.7 I get
> 1
> 2015-01-07 00:00:00
> 1
> Here’s my issue. Why does this machine consider the week to be 1? When the
> correct answer is 2, as given by the other machines.
>
> To add noice to the confusion. If I run this on the CLI on the faulty
> Centos machine:
> lasso9 -s "date -> week”
> I get
> 2
> ?!? Same machine gives me different answers depending on where I ask. I
> can confirm that this is not related to a specific instanced. I have three
> instances running on the machine and the error is there regardless of
> instance.This has me very confused, and clients irritated since this is a
> production server.
>
> Any clues out there?
>
> HDB
> Jolle
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Weird date week error Lasso 9

Jolle Carlestam-2
7 jan 2015 kl. 10:44 skrev Bil Corry <[hidden email]>:

> Can you loop from December 22 through February 1 and output the week number
> for each date?  I'm wondering if it's always 1, or if some pattern emerges.
>
> - Bil

For you, Bil, I’ll do anything.

It does show that it goes awry already when the first week is supposed to start. Looks like it’s assuming I want US weeks, where I of course want ISO weeks.

Code:
local(mydate =date('2014-12-22 00:00:00'))
local(stopdate =date('2015-02-22 00:00:00'))

while(#mydate < #stopdate)
        #mydate -> week
        ' | '
        #mydate
        '\n'
        #mydate -> day += 1
/while

Result faulty server:
52 | 2014-12-22 00:00:00
52 | 2014-12-23 00:00:00
52 | 2014-12-24 00:00:00
52 | 2014-12-25 00:00:00
52 | 2014-12-26 00:00:00
52 | 2014-12-27 00:00:00
53 | 2014-12-28 00:00:00
53 | 2014-12-29 00:00:00
53 | 2014-12-30 00:00:00
53 | 2014-12-31 00:00:00
53 | 2015-01-01 00:00:00
53 | 2015-01-02 00:00:00
53 | 2015-01-03 00:00:00
1 | 2015-01-04 00:00:00
1 | 2015-01-05 00:00:00
1 | 2015-01-06 00:00:00
1 | 2015-01-07 00:00:00
1 | 2015-01-08 00:00:00
1 | 2015-01-09 00:00:00
1 | 2015-01-10 00:00:00
2 | 2015-01-11 00:00:00
2 | 2015-01-12 00:00:00
2 | 2015-01-13 00:00:00
2 | 2015-01-14 00:00:00
2 | 2015-01-15 00:00:00
2 | 2015-01-16 00:00:00
2 | 2015-01-17 00:00:00
3 | 2015-01-18 00:00:00
3 | 2015-01-19 00:00:00
3 | 2015-01-20 00:00:00
3 | 2015-01-21 00:00:00
3 | 2015-01-22 00:00:00
3 | 2015-01-23 00:00:00
3 | 2015-01-24 00:00:00
4 | 2015-01-25 00:00:00
4 | 2015-01-26 00:00:00
4 | 2015-01-27 00:00:00
4 | 2015-01-28 00:00:00
4 | 2015-01-29 00:00:00
4 | 2015-01-30 00:00:00
4 | 2015-01-31 00:00:00
5 | 2015-02-01 00:00:00


Result local machine (Correct):
52 | 2014-12-22 00:00:00
52 | 2014-12-23 00:00:00
52 | 2014-12-24 00:00:00
52 | 2014-12-25 00:00:00
52 | 2014-12-26 00:00:00
52 | 2014-12-27 00:00:00
52 | 2014-12-28 00:00:00
1 | 2014-12-29 00:00:00
1 | 2014-12-30 00:00:00
1 | 2014-12-31 00:00:00
1 | 2015-01-01 00:00:00
1 | 2015-01-02 00:00:00
1 | 2015-01-03 00:00:00
1 | 2015-01-04 00:00:00
2 | 2015-01-05 00:00:00
2 | 2015-01-06 00:00:00
2 | 2015-01-07 00:00:00
2 | 2015-01-08 00:00:00
2 | 2015-01-09 00:00:00
2 | 2015-01-10 00:00:00
2 | 2015-01-11 00:00:00
3 | 2015-01-12 00:00:00
3 | 2015-01-13 00:00:00
3 | 2015-01-14 00:00:00
3 | 2015-01-15 00:00:00
3 | 2015-01-16 00:00:00
3 | 2015-01-17 00:00:00
3 | 2015-01-18 00:00:00
4 | 2015-01-19 00:00:00
4 | 2015-01-20 00:00:00
4 | 2015-01-21 00:00:00
4 | 2015-01-22 00:00:00
4 | 2015-01-23 00:00:00
4 | 2015-01-24 00:00:00
4 | 2015-01-25 00:00:00
5 | 2015-01-26 00:00:00
5 | 2015-01-27 00:00:00
5 | 2015-01-28 00:00:00
5 | 2015-01-29 00:00:00
5 | 2015-01-30 00:00:00
5 | 2015-01-31 00:00:00
5 | 2015-02-01 00:00:00


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Weird date week error Lasso 9

Jolle Carlestam-2
7 jan 2015 kl. 10:56 skrev Jolle Carlestam <[hidden email]>:

> It does show that it goes awry already when the first week is supposed to start. Looks like it’s assuming I want US weeks, where I of course want ISO weeks.


Bil put me on the track to finding out the discrepancy. It’s the locale.

Code
locale_default

Produces
My local machine
sv_SE (Correct)

The other Centos, that got the weeks right
en_AU (Is ok, it’s in Australia)

The faulty machine
en_US_POSIX (Completely wrong!)

When tested from the CLI
locale (Whatever that means, it gets the right week number though.)

So, now all I need to figure out is why the faulty machine considers it to be in the US…

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Weird date week error Lasso 9

Bil Corry-3
In reply to this post by Jolle Carlestam-2
Sounds like the locale for that machine is in the US.  Try setting the
Centos locale to somewhere in Europe.  Or perhaps setting the Lasso locale
will fix it?

Lasso Locale
http://www.lassosoft.com/lassoDocs/languageReference?s=40

- Bil

On Wed, Jan 7, 2015 at 10:56 AM, Jolle Carlestam <[hidden email]>
wrote:

> 7 jan 2015 kl. 10:44 skrev Bil Corry <[hidden email]>:
>
> > Can you loop from December 22 through February 1 and output the week
> number
> > for each date?  I'm wondering if it's always 1, or if some pattern
> emerges.
> >
> > - Bil
>
> For you, Bil, I’ll do anything.
>
> It does show that it goes awry already when the first week is supposed to
> start. Looks like it’s assuming I want US weeks, where I of course want ISO
> weeks.
>
> Code:
> local(mydate =date('2014-12-22 00:00:00'))
> local(stopdate =date('2015-02-22 00:00:00'))
>
> while(#mydate < #stopdate)
>         #mydate -> week
>         ' | '
>         #mydate
>         '\n'
>         #mydate -> day += 1
> /while
>
> Result faulty server:
> 52 | 2014-12-22 00:00:00
> 52 | 2014-12-23 00:00:00
> 52 | 2014-12-24 00:00:00
> 52 | 2014-12-25 00:00:00
> 52 | 2014-12-26 00:00:00
> 52 | 2014-12-27 00:00:00
> 53 | 2014-12-28 00:00:00
> 53 | 2014-12-29 00:00:00
> 53 | 2014-12-30 00:00:00
> 53 | 2014-12-31 00:00:00
> 53 | 2015-01-01 00:00:00
> 53 | 2015-01-02 00:00:00
> 53 | 2015-01-03 00:00:00
> 1 | 2015-01-04 00:00:00
> 1 | 2015-01-05 00:00:00
> 1 | 2015-01-06 00:00:00
> 1 | 2015-01-07 00:00:00
> 1 | 2015-01-08 00:00:00
> 1 | 2015-01-09 00:00:00
> 1 | 2015-01-10 00:00:00
> 2 | 2015-01-11 00:00:00
> 2 | 2015-01-12 00:00:00
> 2 | 2015-01-13 00:00:00
> 2 | 2015-01-14 00:00:00
> 2 | 2015-01-15 00:00:00
> 2 | 2015-01-16 00:00:00
> 2 | 2015-01-17 00:00:00
> 3 | 2015-01-18 00:00:00
> 3 | 2015-01-19 00:00:00
> 3 | 2015-01-20 00:00:00
> 3 | 2015-01-21 00:00:00
> 3 | 2015-01-22 00:00:00
> 3 | 2015-01-23 00:00:00
> 3 | 2015-01-24 00:00:00
> 4 | 2015-01-25 00:00:00
> 4 | 2015-01-26 00:00:00
> 4 | 2015-01-27 00:00:00
> 4 | 2015-01-28 00:00:00
> 4 | 2015-01-29 00:00:00
> 4 | 2015-01-30 00:00:00
> 4 | 2015-01-31 00:00:00
> 5 | 2015-02-01 00:00:00
>
>
> Result local machine (Correct):
> 52 | 2014-12-22 00:00:00
> 52 | 2014-12-23 00:00:00
> 52 | 2014-12-24 00:00:00
> 52 | 2014-12-25 00:00:00
> 52 | 2014-12-26 00:00:00
> 52 | 2014-12-27 00:00:00
> 52 | 2014-12-28 00:00:00
> 1 | 2014-12-29 00:00:00
> 1 | 2014-12-30 00:00:00
> 1 | 2014-12-31 00:00:00
> 1 | 2015-01-01 00:00:00
> 1 | 2015-01-02 00:00:00
> 1 | 2015-01-03 00:00:00
> 1 | 2015-01-04 00:00:00
> 2 | 2015-01-05 00:00:00
> 2 | 2015-01-06 00:00:00
> 2 | 2015-01-07 00:00:00
> 2 | 2015-01-08 00:00:00
> 2 | 2015-01-09 00:00:00
> 2 | 2015-01-10 00:00:00
> 2 | 2015-01-11 00:00:00
> 3 | 2015-01-12 00:00:00
> 3 | 2015-01-13 00:00:00
> 3 | 2015-01-14 00:00:00
> 3 | 2015-01-15 00:00:00
> 3 | 2015-01-16 00:00:00
> 3 | 2015-01-17 00:00:00
> 3 | 2015-01-18 00:00:00
> 4 | 2015-01-19 00:00:00
> 4 | 2015-01-20 00:00:00
> 4 | 2015-01-21 00:00:00
> 4 | 2015-01-22 00:00:00
> 4 | 2015-01-23 00:00:00
> 4 | 2015-01-24 00:00:00
> 4 | 2015-01-25 00:00:00
> 5 | 2015-01-26 00:00:00
> 5 | 2015-01-27 00:00:00
> 5 | 2015-01-28 00:00:00
> 5 | 2015-01-29 00:00:00
> 5 | 2015-01-30 00:00:00
> 5 | 2015-01-31 00:00:00
> 5 | 2015-02-01 00:00:00
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Weird date week error Lasso 9

Jolle Carlestam-2
7 jan 2015 kl. 11:13 skrev Bil Corry <[hidden email]>:

> Sounds like the locale for that machine is in the US.  Try setting the
> Centos locale to somewhere in Europe.  Or perhaps setting the Lasso locale
> will fix it?

Not sure how to set the Centos locale. or even find out what it’s set to. When I run
locale
on the CLI it says it’s set to Swedish. But that could be for my login, I don’t know how to check what the locale is for another user, like _lasso.

But, I could fix the issue from inside Lasso.
I’ve placed this
locale_setDefault(locale('sv_SE’))
in a file that runs at startup.

That seems to have cleared the issue.

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Weird date week error Lasso 9

Bil Corry-3
For consistency across deployments, that's probably the best solution
anyhow.

- Bil

On Wed, Jan 7, 2015 at 11:35 AM, Jolle Carlestam <[hidden email]>
wrote:

> 7 jan 2015 kl. 11:13 skrev Bil Corry <[hidden email]>:
>
> > Sounds like the locale for that machine is in the US.  Try setting the
> > Centos locale to somewhere in Europe.  Or perhaps setting the Lasso
> locale
> > will fix it?
>
> Not sure how to set the Centos locale. or even find out what it’s set to.
> When I run
> locale
> on the CLI it says it’s set to Swedish. But that could be for my login, I
> don’t know how to check what the locale is for another user, like _lasso.
>
> But, I could fix the issue from inside Lasso.
> I’ve placed this
> locale_setDefault(locale('sv_SE’))
> in a file that runs at startup.
>
> That seems to have cleared the issue.
>
> HDB
> Jolle
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Weird date week error Lasso 9

Jolle Carlestam-2
7 jan 2015 kl. 11:44 skrev Bil Corry <[hidden email]>:

> - Bil

Thanks for your interest and help!

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Weird date week error Lasso 9

Marc Vos-3
In reply to this post by Jolle Carlestam-2
I think you'll still have problems when comparing Lasso dates with MySQL timestamps, FTP-log entries or file_listdirectory because the those dates will be off compared to Lasso's date.

Recently I was having these problems. Chris WIk activated the NTP setting for me to sync with a European timeserver and removed a timezone setting in ProFTPd conf. Since then all times are in sync.

- -
Regards,
Marc

On 7 jan. 2015, at 11:35, Jolle Carlestam <[hidden email]> wrote:

> 7 jan 2015 kl. 11:13 skrev Bil Corry <[hidden email]>:
>
>> Sounds like the locale for that machine is in the US.  Try setting the
>> Centos locale to somewhere in Europe.  Or perhaps setting the Lasso locale
>> will fix it?
>
> Not sure how to set the Centos locale. or even find out what it’s set to. When I run
> locale
> on the CLI it says it’s set to Swedish. But that could be for my login, I don’t know how to check what the locale is for another user, like _lasso.
>
> But, I could fix the issue from inside Lasso.
> I’ve placed this
> locale_setDefault(locale('sv_SE’))
> in a file that runs at startup.
>
> That seems to have cleared the issue.
>
> HDB
> Jolle
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Weird date week error Lasso 9

Jolle Carlestam-2
7 jan 2015 kl. 12:01 skrev Marc Vos <[hidden email]>:

> I think you'll still have problems when comparing Lasso dates with MySQL timestamps, FTP-log entries or file_listdirectory because the those dates will be off compared to Lasso's date.
>
> Recently I was having these problems. Chris WIk activated the NTP setting for me to sync with a European timeserver and removed a timezone setting in ProFTPd conf. Since then all times are in sync.

This has not been an issue for me. Actually the only beef would be if Mysql acted up, I don’t do ftp on our servers.
But running a quick test shows nothing to be concerned about:
Having Lasso issue this query:
SELECT NOW()
Gives me the exact same value as when doing a simple date inside Lasso

2015-01-07 12:23:50
2015-01-07 12:23:50

I my case I am more suspecting that the Lasso instances got it wrong somewhere starting to think they should use a US locale but that the Centos OS in itself has been clear on where it is supposed to be.

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>