Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format date or date period

Status
Not open for further replies.

TomHW

Programmer
Sep 8, 2004
100
US
I have a field to store a date for a document. The document, however, may have a period of dates (ie 3/28/04-4/15/04). I like using the date/time format because it allows for all viewing of dates to be converted to a specific format, no matter what format the user enters. The problem is when a period of dates need to be entered. Is there anyway to have a field format a field to a specific date format whether or not it is entered as a specific date or a period of dates.

Examples of what I would like:

input: 3/28/04
format: 03/28/04

input: March 28, 2004
format: 03/28/04

input 3/28/2004-4/15/2004
format: 03/28/04-4/15/04

input: Jan 5, 2004-02/5/2004
format: 01/05/04-02/05/04

I do not mind changing the type of the field, but any help on how this might be able to be accomplished would be very much appreciated.

Thanks,
Tom
 
Basically No.

You would have to set the field as a text field; then you would have to parse the input in code and work out the different bits of the input. Format them separately and join them back together again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top