[Glass] TimeStamp format

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Glass] TimeStamp format

GLASS mailing list
Ciao,

        i have a problem when i print  a TimeStamp

        ( TimeStamp  fromString: '10-28-2014 11:11:11 am') report -> 10/28/2014 11:11:11


        The system don't  report the dd  mm  year    format as i need.

        I setup the system with:

        run
        | time |
        time:= TimeZone timeDifferenceHrs: 1 dstHrs: 1 atTimeHrs: 2
        fromDayNum: 95 toDayNum: 304 on:  #Sunday beginning: 1967
        stdPrintString: 'Germany Standard Time' dstPrintString: 'Germany Legal Time'.
        TimeZone for:#Germany put: time.
        TimeZone default: time

       
        DateTime now. report -> 25/11/2014 16:26:28  ( it's right ).


        Into GLASS 2.4 the system report  TimeStamp  in the right format,

         and i think don't did any other change - setup into it.

       
        Considerations?


        Thank,

                        Dario
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] TimeStamp format

GLASS mailing list
I forgot:

        I have a problem into GLASS 3.1.0.6.

> Ciao,
>
> i have a problem when i print  a TimeStamp
>
> ( TimeStamp  fromString: '10-28-2014 11:11:11 am') report -> 10/28/2014 11:11:11
>
>
> The system don't  report the dd  mm  year    format as i need.
>
> I setup the system with:
>
> run
> | time |
> time:= TimeZone timeDifferenceHrs: 1 dstHrs: 1 atTimeHrs: 2
> fromDayNum: 95 toDayNum: 304 on:  #Sunday beginning: 1967
> stdPrintString: 'Germany Standard Time' dstPrintString: 'Germany Legal Time'.
> TimeZone for:#Germany put: time.
> TimeZone default: time
>
>
> DateTime now. report -> 25/11/2014 16:26:28  ( it's right ).
>
>
> Into GLASS 2.4 the system report  TimeStamp  in the right format,
>
> and i think don't did any other change - setup into it.
>
>
> Considerations?
>
>
> Thank,
>
> Dario
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] TimeStamp format

GLASS mailing list
Dario,

In order to control the format of Date printing you need to use #asStringUsingFormat:. The format array for DD/MM/YYY is:

  #(1 2 3 $/ 1 1 $: true true false)

TimeStamp does not implement #asStringUsingFormat: but it should and it should look like this:

asStringUsingFormat: anArray
  "Returns a String that expresses the receiver in the format defined by anArray.
 Generates an error if anArray contains an incorrect formatting specification.

 See the class documentation of Date for a complete description of the
 String-formatting specification Array."

  | strm |
  strm := WriteStream on: String new.
  strm
    nextPutAll: (self date asStringUsingFormat: anArray);
    space;
    nextPutAll: self time printString.
  ^ strm contents

I will be adding this method into the GLASS master branch shortly ... I've submitted an issue for this[1] ...

Dale

On Tue, Nov 25, 2014 at 8:38 AM, Dario Trussardi via Glass <[hidden email]> wrote:
I forgot:

        I have a problem into GLASS 3.1.0.6.

> Ciao,
>
>       i have a problem when i print  a TimeStamp
>
>       ( TimeStamp  fromString: '10-28-2014 11:11:11 am')              report   ->              10/28/2014 11:11:11
>
>
>       The system don't  report the     dd  mm  year    format as i need.
>
>       I setup the system with:
>
>       run
>       | time |
>       time:= TimeZone timeDifferenceHrs: 1 dstHrs: 1 atTimeHrs: 2
>       fromDayNum: 95 toDayNum: 304 on:  #Sunday beginning: 1967
>       stdPrintString: 'Germany Standard Time' dstPrintString: 'Germany Legal Time'.
>       TimeZone for:#Germany put: time.
>       TimeZone default: time
>
>
>       DateTime now.    report         ->      25/11/2014 16:26:28  ( it's right ).
>
>
>       Into GLASS 2.4 the system report  TimeStamp  in the right format,
>
>        and i think don't did any other change - setup into it.
>
>
>       Considerations?
>
>
>       Thank,
>
>                       Dario
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass