Link to home
Start Free TrialLog in
Avatar of Cactus1993
Cactus1993Flag for United States of America

asked on

Word Date Text Formatting Question

This should be ridiculously easy ... but I cannot figure it out for the life of me. It's easy in Excel, but in Word 2007, how to I change date text formatting to a YYYMMDD format?  It's not one of the standard date format options, but I managed to do it before and can't figure out now how I did it.

Example. In my footer, I want my document revision to be manually updatable, and when I do I want it to be in -- and remain in -- the format YYYMMDD (or 20090714 as an example of today.)

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Brian Withun
Brian Withun
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cactus1993

ASKER

Thanks for your answer and lengthy explanation. However, somehow I did manage at one time to modify the date format in Word 2007 to YYYYMMDD ... something along the lines of formatting a text box, formatting the text itself, or something similar that I just can't seem to recreate. Is it a .docx vs. .doc issue? Is it done through modifying styles of some sort? Somehow I did it before, and need to figure out how to do it again. Thanks ... I have to keep trying though.
In excel I can enter the date of July 6, 2009 by typing "7/6/2009" but also by typing the number 40000, assuming that the cell has the proper format applied to it.  (I'll bet you didn't know that July 7, 2009 was the 40,000th day since January 1, 1900)

In Word, when I type a date, I'm typing:

7, /, 6, /, 2, 0, 0, 9.

After these eight keystrokes, Word is NOT going to change my keystrokes into something else.

How are you "entering" these dates that you are expecting to be reformatted?

I'm simply using the process

Insert > Date & Time

The available formats I can choose from are 17 different formats. Unfortunately, YYYYMMDD isn't one of them, but like I said, somehow I was given the option to enter YYYYMMDD in a text box to format it that way before. I just can't remember how I got to the option box that allowed me to do that.
Avatar of GrahamSkan
Excellent exposition, Brian.

To follow on, it means that Word is not designed to constrain the author as a data-entry system might be, though there are some techniques that could be bent towards that purpose.

I suggest using a Custom property with a type of 'Date' and using a DocProperty field to display it in the document with your desired format as a date switch.
With all due respect -- because you both are obviously extremely familiar and educated in MS Word 2007 -- I think we're making this more difficult than it has to be. Somehow, someway, in my limited knowledge of Word I stumbled across a way that I actually got Word to give me a formatting option for my Insert > Date placement, and I simply entered YYYYMMDD in the formatting entry box to get the 20090714 date format I need. It's driving me a little nuts that I can't recreate the way in which I got to that point. Thanks again, guys, I appreciate the time and help you're giving to this....
To affect that I believe you are going to have to adjust your system Regional and Language Options.

For instance, I have just created a new date format of yyyy*mm*dd.

I was unsuccessful in creating a date without a delimiter, such as yyyymmdd.

Brian
word-date.JPG
new-date-format.JPG
Cactus,

Word pulls its date formatting from the default XP date and time formats.  What you can do to get what you need is go to Control Panel-->Regional and Language options-->click on the CUSTOMIZE button-->go to DATE tab-->click the drop down menu for the short date format and select yyyy MM dd and in the date seperator you will need to put a blank SPACE so that it does not use a period, slash, or forward slash.

Click OK all the way out and you will now see it as an option in Word (INSERT-->DATE & TIME).

Hope that helps
Now this is really driving me crazy. Thanks jmart ... but I know I didn't go into the Control Panel to change regional settings when I somehow got to the option of entering YYYMMDD to change the date formatting. I stumbled across it another way.
As Brian says, entered text is not easily modified to a particular format. Formatting switches can be applied to fields, because they are computed and do not necessarily display the text from their given source of data asis.

I think that I will have to part company with others at this point. Windows regional setting do not make any difference to the default display in Word. As many of us have found out, Word always defaults to standard American formats.

Once entered, the date format switch for a field can be added or modified to your required display;

Use Alt + F4 to show field codes, then make sure that you have  the switch \@ yyyyMMdd added, so that your filed looks like:

{ DATE \@ yyyyMMdd }

Alt+F4 will switch back to field results display. Also F9 will update the results of the fields in the Selection.
Hahaha...I know what you mean.  It sounds like such an easy solution, yet so hard.  Anyhow, I've tested my solution above and it works.  So if all else fails, give it a shot.
Graham: Alt + F4 gives me a "Do you want to save changes to Document 1?" pop up box. Also, I haven't entered any fields ... only the Insert > Date & Time (which may be considered a field, and if so, my apologies.) Still, Alt + F4 closes out my document. Am I misreading what I need to do here?
I stand by my claim that if you typed your custom date format directly into Word, then what you were doing at that time was adding a FIELD, not simply Insert > Date and Time...

Let the history books be the judge.

In the words of Captain Jack Sparrow:  Gentlemen, I wash my hands of this weirdness.

Good Luck

Brian
Withun

Guys:

I figured it out.

When I used Insert > Date & Time, and DID NOT check the "Update automatically" checkbox, I COULD NOT change the formatting of the date.

When I used Insert > Date & Time, and DID check the "Update automatically" checkbox, I COULD change the formatting of the date. Apparently in checking the "Update automatically" checkbox, it turned the inserted date into a field, as you were alluding to.
What I did then was simply right click that date "field," and it gave me the Field and Field Properties pop-up box, where I could then enter my YYYYMMDD format.
Thanks everyone for your help on this!

Doc3.pdf
Sorry, I meant to type 'Alt + F9'