Weird Date Formatting Issue

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

Weird Date Formatting Issue

Marc Pinnell-3
Missing something obvious here, I would guess. The date is changing when I format it!

[date_format(date(#currentWeek), -format='MMMM d, yyyy')] || [#currentWeek]
==> December 3, 2014 || 2014-12-04 00-00-01

[date_format(#currentWeek, -format='MMMM d, yyyy')] || [#currentWeek]
==> December 3, 2014 || 2014-12-04 00-00-01

[date(#currentWeek)->format('MMMM d, yyyy')] || [#currentWeek]
==> December 3, 2014 || 2014-12-04 00-00-01


Any ideas?


Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



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

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 Formatting Issue

Brad Lindsay
What version of Lasso 9 are you running and on what operating system?

When I issue the following code:
    date('2014-12-04 00-00-01')->format('MMMM d, yyyy’)

I get the correct response:
    December 4, 2014


And this is with Lasso 9.2.7 on OS X 10.10

Brad

On December 4, 2014 at 3:11:10 PM, Marc Pinnell ([hidden email]) wrote:

> Missing something obvious here, I would guess. The date is changing when I format it!  
>  
> [date_format(date(#currentWeek), -format='MMMM d, yyyy')] || [#currentWeek]
> ==> December 3, 2014 || 2014-12-04 00-00-01
>  
> [date_format(#currentWeek, -format='MMMM d, yyyy')] || [#currentWeek]
> ==> December 3, 2014 || 2014-12-04 00-00-01
>  
> [date(#currentWeek)->format('MMMM d, yyyy')] || [#currentWeek]
> ==> December 3, 2014 || 2014-12-04 00-00-01
>  
>  
> Any ideas?
>  
>  
> Marc Pinnell
> 1027 Design
> PO Box 990872
> Redding, CA 96099-0872
> 530.941.4706
> fax: 866.232.5300
> www.1027Design.com
>  
>  
>  
> #############################################################
>  
> 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:  
> Send administrative queries to  
>  


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

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 Formatting Issue

Marc Pinnell-3
L9.2.6 on OS 10.9.5

Sent from my iPhone

> On Dec 4, 2014, at 12:26 PM, Brad Lindsay <[hidden email]> wrote:
>
> What version of Lasso 9 are you running and on what operating system?
>
> When I issue the following code:
>     date('2014-12-04 00-00-01')->format('MMMM d, yyyy’)
>
> I get the correct response:
>     December 4, 2014
>
>
> And this is with Lasso 9.2.7 on OS X 10.10
>
> Brad
>
>> On December 4, 2014 at 3:11:10 PM, Marc Pinnell ([hidden email]) wrote:
>> Missing something obvious here, I would guess. The date is changing when I format it!  
>>
>> [date_format(date(#currentWeek), -format='MMMM d, yyyy')] || [#currentWeek]
>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>
>> [date_format(#currentWeek, -format='MMMM d, yyyy')] || [#currentWeek]
>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>
>> [date(#currentWeek)->format('MMMM d, yyyy')] || [#currentWeek]
>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>
>>
>> Any ideas?
>>
>>
>> Marc Pinnell
>> 1027 Design
>> PO Box 990872
>> Redding, CA 96099-0872
>> 530.941.4706
>> fax: 866.232.5300
>> www.1027Design.com
>>
>>
>>
>> #############################################################
>>
>> 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:  
>> Send administrative queries to  
>>
>
>
> #############################################################
>
> 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 Formatting Issue

Jolle Carlestam-2
In reply to this post by Marc Pinnell-3
4 dec 2014 kl. 21:11 skrev Marc Pinnell <[hidden email]>:

> Missing something obvious here, I would guess. The date is changing when I format it!
>
> [date_format(date(#currentWeek), -format='MMMM d, yyyy')] || [#currentWeek]
> ==> December 3, 2014 || 2014-12-04 00-00-01
>
> [date_format(#currentWeek, -format='MMMM d, yyyy')] || [#currentWeek]
> ==> December 3, 2014 || 2014-12-04 00-00-01
>
> [date(#currentWeek)->format('MMMM d, yyyy')] || [#currentWeek]
> ==> December 3, 2014 || 2014-12-04 00-00-01

How do you create #currentWeek?

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 Formatting Issue

Marc Pinnell-3
Field from a database table:

        var(SQLParams = 'SELECT DefaultData AS polldate FROM Poll_Defaults WHERE DefaultDataType = "PollDate-Display";')

        with polldata in site_ds->sql($SQLParams)->rows do {^
                #currentWeek = #polldata(::polldate)
                ^}



On Dec 4, 2014, at 12:41 PM, Jolle Carlestam <[hidden email]> wrote:

> 4 dec 2014 kl. 21:11 skrev Marc Pinnell <[hidden email]>:
>
>> Missing something obvious here, I would guess. The date is changing when I format it!
>>
>> [date_format(date(#currentWeek), -format='MMMM d, yyyy')] || [#currentWeek]
>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>
>> [date_format(#currentWeek, -format='MMMM d, yyyy')] || [#currentWeek]
>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>
>> [date(#currentWeek)->format('MMMM d, yyyy')] || [#currentWeek]
>> ==> December 3, 2014 || 2014-12-04 00-00-01
>
> How do you create #currentWeek?
>
> 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]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



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

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 Formatting Issue

stevepiercy
In reply to this post by Marc Pinnell-3
It's probably a locale issue, flopping back and forth over time
zones.  You should set a locale on your date type, then format it.

--steve


On 12/4/14 at 12:11 PM, [hidden email] (Marc
Pinnell) pronounced:

>Missing something obvious here, I would guess. The date is changing when I format it!
>
>[date_format(date(#currentWeek), -format='MMMM d, yyyy')] || [#currentWeek]
>==> December 3, 2014 || 2014-12-04 00-00-01
>
>[date_format(#currentWeek, -format='MMMM d, yyyy')] || [#currentWeek]
>==> December 3, 2014 || 2014-12-04 00-00-01
>
>[date(#currentWeek)->format('MMMM d, yyyy')] || [#currentWeek]
>==> December 3, 2014 || 2014-12-04 00-00-01
>
>
>Any ideas?
>
>
>Marc Pinnell
>1027 Design
>PO Box 990872
>Redding, CA 96099-0872
>530.941.4706
>fax: 866.232.5300
>www.1027Design.com
>
>
>
>#############################################################
>
>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]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


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

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 Formatting Issue

Marc Pinnell-3
Removing the "time" from #currentweek makes it work as expected. I could see how locale might come into play with the time in there.

marc


On Dec 4, 2014, at 1:15 PM, Steve Piercy - Website Builder <[hidden email]> wrote:

> It's probably a locale issue, flopping back and forth over time zones.  You should set a locale on your date type, then format it.
>
> --steve
>
>
> On 12/4/14 at 12:11 PM, [hidden email] (Marc Pinnell) pronounced:
>
>> Missing something obvious here, I would guess. The date is changing when I format it!
>>
>> [date_format(date(#currentWeek), -format='MMMM d, yyyy')] || [#currentWeek]
>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>
>> [date_format(#currentWeek, -format='MMMM d, yyyy')] || [#currentWeek]
>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>
>> [date(#currentWeek)->format('MMMM d, yyyy')] || [#currentWeek]
>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>
>>
>> Any ideas?
>>
>>
>> Marc Pinnell
>> 1027 Design
>> PO Box 990872
>> Redding, CA 96099-0872
>> 530.941.4706
>> fax: 866.232.5300
>> www.1027Design.com
>>
>>
>>
>> #############################################################
>>
>> 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]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> 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]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



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

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 Formatting Issue

stevepiercy
Oh, locale most certainly does.  That was a hard lesson learned
for me when migrating a solution from 8 to 9.  Even if you think
you have it down with your "fix", you should use a locale.  Can
I get an "amen"?

--steve


On 12/4/14 at 1:17 PM, [hidden email] (Marc
Pinnell) pronounced:

>Removing the "time" from #currentweek makes it work as
>expected. I could see how locale might come into play with the
>time in there.
>
>marc
>
>
>On Dec 4, 2014, at 1:15 PM, Steve Piercy - Website Builder <[hidden email]> wrote:
>
>>It's probably a locale issue, flopping back and forth over time zones.  You should set
>a locale on your date type, then format it.
>>
>>--steve
>>
>>
>>On 12/4/14 at 12:11 PM, [hidden email] (Marc Pinnell) pronounced:
>>
>>> Missing something obvious here, I would guess. The date is changing when I format it!
>>>   [date_format(date(#currentWeek), -format='MMMM d, yyyy')]
>>>|| [#currentWeek]
>>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>>   [date_format(#currentWeek, -format='MMMM d, yyyy')] || [#currentWeek]
>>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>>   [date(#currentWeek)->format('MMMM d, yyyy')] || [#currentWeek]
>>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>>    Any ideas?
>>>    Marc Pinnell
>>> 1027 Design
>>> PO Box 990872
>>> Redding, CA 96099-0872
>>> 530.941.4706
>>> fax: 866.232.5300
>>> www.1027Design.com
>>>     #############################################################
>>>   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]>
>>
>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>Steve Piercy              Website Builder              Soquel, CA
>><[hidden email]>               <http://www.StevePiercy.com/>
>>
>>
>>#############################################################
>>
>>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]>
>
>Marc Pinnell
>1027 Design
>PO Box 990872
>Redding, CA 96099-0872
>530.941.4706
>fax: 866.232.5300
>www.1027Design.com
>
>
>
>#############################################################
>
>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]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


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

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 Formatting Issue

Marc Pinnell-3
Amen brotha!

lol

Marc


On Dec 4, 2014, at 1:23 PM, Steve Piercy - Website Builder <[hidden email]> wrote:

> Oh, locale most certainly does.  That was a hard lesson learned for me when migrating a solution from 8 to 9.  Even if you think you have it down with your "fix", you should use a locale.  Can I get an "amen"?
>
> --steve
>
>
> On 12/4/14 at 1:17 PM, [hidden email] (Marc Pinnell) pronounced:
>
>> Removing the "time" from #currentweek makes it work as expected. I could see how locale might come into play with the time in there.
>>
>> marc
>>
>>
>> On Dec 4, 2014, at 1:15 PM, Steve Piercy - Website Builder <[hidden email]> wrote:
>>
>>> It's probably a locale issue, flopping back and forth over time zones.  You should set
>> a locale on your date type, then format it.
>>>
>>> --steve
>>>
>>>
>>> On 12/4/14 at 12:11 PM, [hidden email] (Marc Pinnell) pronounced:
>>>
>>>> Missing something obvious here, I would guess. The date is changing when I format it!
>>>>  [date_format(date(#currentWeek), -format='MMMM d, yyyy')] || [#currentWeek]
>>>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>>>  [date_format(#currentWeek, -format='MMMM d, yyyy')] || [#currentWeek]
>>>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>>>  [date(#currentWeek)->format('MMMM d, yyyy')] || [#currentWeek]
>>>> ==> December 3, 2014 || 2014-12-04 00-00-01
>>>>   Any ideas?
>>>>   Marc Pinnell
>>>> 1027 Design
>>>> PO Box 990872
>>>> Redding, CA 96099-0872
>>>> 530.941.4706
>>>> fax: 866.232.5300
>>>> www.1027Design.com
>>>>    #############################################################
>>>>  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]>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy              Website Builder              Soquel, CA
>>> <[hidden email]>               <http://www.StevePiercy.com/>
>>>
>>>
>>> #############################################################
>>>
>>> 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]>
>>
>> Marc Pinnell
>> 1027 Design
>> PO Box 990872
>> Redding, CA 96099-0872
>> 530.941.4706
>> fax: 866.232.5300
>> www.1027Design.com
>>
>>
>>
>> #############################################################
>>
>> 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]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> 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]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



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

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]>