Date Parser

S

Steve D

Has anyone developed a comprehensive VBA date parser?

I do a lot of web research and find it easier to have all my research
articles converted to a standard format (I know, "consistency is the
hobgoblin of..."). I have written a utility macro that puts the document
into a standard format I like. It enforces consistent formats on document
titles, subtitles, section headings, converts "* " to "List Bullet" style,
cleans up erratic character useage, etc. Everything works quite well.

I still have to convert dates manually because date formats are all over the
map. Examples include 02-May-03, May 2, 2003, Tuesday 2 May 03, etc.

Does anyone have a parser that handles such a wide variety of dates and
converts them to a standard form?
 
J

Jonathan West

Hi
Steve D said:
Has anyone developed a comprehensive VBA date parser?

I do a lot of web research and find it easier to have all my research
articles converted to a standard format (I know, "consistency is the
hobgoblin of..."). I have written a utility macro that puts the document
into a standard format I like. It enforces consistent formats on document
titles, subtitles, section headings, converts "* " to "List Bullet" style,
cleans up erratic character useage, etc. Everything works quite well.

I still have to convert dates manually because date formats are all over
the
map. Examples include 02-May-03, May 2, 2003, Tuesday 2 May 03, etc.

Does anyone have a parser that handles such a wide variety of dates and
converts them to a standard form?


The CDate function does a pretty good job, provided you leave out day names.
When I tested it, it handled 02-May-03, May 2, 2003, and 2 May 03 just fine.
 
S

Steve D

Hi, Jonathan. Thanks, I forgot about CDate function.

I tried it on "02.02.05" (the first date format I found to test) and it
converted it to a time, "2:02:05 AM".

I did some more testing and find that it always parses periods to times.
It's pretty versatile otherwise.
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top