Date reading and writing

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

Date reading and writing

GLASS mailing list
Hi All,

I use a bunch of frameworks like Magritte, NeoCSV, NeoJSON and others that all write dates based on aDate-#asString (which formats dates in USA date format) and read based on Date-#readFrom: (which reads expecting USA date format).

Since the USA is the only country that uses this format, how is everyone else dealing with it?

Overriding date printing and reading in each framework seems counter-productive and fraught with error, as does replacing #asString and #readFrom: in Date itself.

There doesn’t appear to be Date related stuff in Locale, so I’m guessing I’m missing something simple here :)

Any advice would be much appreciated.

Cheers,

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

Re: Date reading and writing

GLASS mailing list

Yes, always a mess ... we wrote our own code ...

And as always ... Gemstone/S is based on ICU libraries, they have all stuff available to use these low-level mainstream libraries but they hide it everywhere ... it would be really nice, if they have a way of accessing their with the product delivered libraries.

As with TimeStamps - I decided to go with RFC3339 format - so our libraries in C#, Java, Python and Javascript are able to read these data.


Marten

Jupiter Jones via Glass <[hidden email]> hat am 30. Mai 2019 um 02:38 geschrieben:


Hi All,

I use a bunch of frameworks like Magritte, NeoCSV, NeoJSON and others that all write dates based on aDate-#asString (which formats dates in USA date format) and read based on Date-#readFrom: (which reads expecting USA date format).

Since the USA is the only country that uses this format, how is everyone else dealing with it?

Overriding date printing and reading in each framework seems counter-productive and fraught with error, as does replacing #asString and #readFrom: in Date itself.

There doesn’t appear to be Date related stuff in Locale, so I’m guessing I’m missing something simple here :)

Any advice would be much appreciated.

Cheers,

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

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

Re: Date reading and writing

GLASS mailing list
Did you check out `printFormat:` ?
Probably not as extensive as what you can find in full i18n libraries but it does the job for us.

Overall, I think it’s better practice to never rely on `asString` to print anything to the user.

Cheers,
Johan

On 31 May 2019, at 10:40, Marten Feldtmann via Glass <[hidden email]> wrote:

Yes, always a mess ... we wrote our own code ...

And as always ... Gemstone/S is based on ICU libraries, they have all stuff available to use these low-level mainstream libraries but they hide it everywhere ... it would be really nice, if they have a way of accessing their with the product delivered libraries.

As with TimeStamps - I decided to go with RFC3339 format - so our libraries in C#, Java, Python and Javascript are able to read these data.


Marten

Jupiter Jones via Glass <[hidden email]> hat am 30. Mai 2019 um 02:38 geschrieben:


Hi All,

I use a bunch of frameworks like Magritte, NeoCSV, NeoJSON and others that all write dates based on aDate-#asString (which formats dates in USA date format) and read based on Date-#readFrom: (which reads expecting USA date format).

Since the USA is the only country that uses this format, how is everyone else dealing with it?

Overriding date printing and reading in each framework seems counter-productive and fraught with error, as does replacing #asString and #readFrom: in Date itself.

There doesn’t appear to be Date related stuff in Locale, so I’m guessing I’m missing something simple here :)

Any advice would be much appreciated.

Cheers,

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


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