The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Date Parser

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Date Parser Posted: Jun 29, 2004 7:09 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Date Parser
Feed Title: David Buck - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/buck-rss.xml
Feed Description: Smalltalk can do that
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From David Buck - Blog

Advertisement
Many years ago, I got frustrated with the date parsing in VisualWorks so I wrote my own parser using the Advanced Tools Parser Generator. It's not only a useful utility but it's also a good example of the Parser Generator. It can parse the following formats:

  DateStringCompiler readFrom: 'today'
  DateStringCompiler readFrom: 'tomorrow'
  DateStringCompiler readFrom: 'yesterday'
  DateStringCompiler readFrom: 'last week'
  DateStringCompiler readFrom: 'next week'
  DateStringCompiler readFrom: 'friday'
  DateStringCompiler readFrom: 'next friday'
  DateStringCompiler readFrom: 'last friday'
  DateStringCompiler readFrom: 'Jan 3, 2004'
  DateStringCompiler readFrom: 'January 3, 2004'
  DateStringCompiler readFrom: '12/25/2005'
  DateStringCompiler readFrom: '2004-06-29'
  DateStringCompiler readFrom: 'June 6'
  DateStringCompiler readFrom: '6-June-2004'

At the suggestion of Alan Knight, I've published the code in the Cincom Public Store Repository as the package Date Compiler. This code is released under the Creative Commons Attribution License which basically means that you can use or extend this code however you wish (even commercially) so long as you give me credit.

Read: Date Parser

Topic: Extreme Focus Previous Topic   Next Topic Topic: What kind of experience

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use