Parsing dates!

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

Parsing dates!

Göran Krampe
Hi guys!

Ok, I stumbled onto Petr's question about parsing Dates using simple
patterns and couldn't help hacking something up. Attached.

regards, Göran
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

DateReadFromPattern.2.cs.gz (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Parsing dates!

Göran Krampe
Hi!

Eh... and of course the pattern "ymd" doesn't work for obvious reasons -
using "y", "m" and "d" requires some non-digit separators. Feel free to
improve and add more tests etc! I kinda whipped it up - have to go to a
conference soon.

And I presume of course that this stuff exists in Chronos, Chalten or hey,
perhaps even somewhere in base Squeak that I missed. ;)

regards, Göran

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Parsing dates!

Petr Fischer-3
In reply to this post by Göran Krampe
Hi, nice example with streams!
This is shorter and better than my own solution (http://
ss.praguesoft.cz/community/Date-Parsing-pf.5.mcz)

Thanks, pf

On 19.4.2007, at 15:36, Göran Krampe wrote:

> Hi guys!
>
> Ok, I stumbled onto Petr's question about parsing Dates using simple
> patterns and couldn't help hacking something up. Attached.
>
> regards, Göran
> <DateReadFromPattern.2.cs.gz>


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

smime.p7s (3K) Download Attachment