Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 09-17-2013, 08:22 AM
BobBridges's Avatar
BobBridges BobBridges is offline CSV Date Formats Windows 7 64bit CSV Date Formats Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Yeah, that's what I find, too. Excel is writing the dates to the CSV in whatever format you specify, but when it reads a CSV back in—remember, a CSV is plain text, so there are no formatting codes to guide Excel—it just has to make up its own mind. Perhaps there are some formats it simply can't be sure about. I've done a few tests:

yyyy-mm-dd: Upon reading the CSV back into Excel, it's still in yyyy-mm-dd. This result sounds different from yours but it isn't really, because yyyy-mm-dd is the default date format on my machine; I set it in the Control Panel, Regional Settings; so Excel is just following that default.

dddd, mmmm d, yyyy: Excel writes this out to the CSV as a text string ("Tuesday, September 17, 2013"), so that's the way it reads it back in, too; doesn't even know it's a date.

dd-mmm: This comes back as dd-mmm, just as it should. But:

m-d: This comes back as dd-mmm, too. Go figure.

m-dd-yy and mm-dd-yy: These are written to the CSV without quote marks, ie not as character strings. And when they're read back into Excel, they're displayed as they went out; but they're now left justified, and their format reads General rather than a date format. Weird.

dd-mmm-yy: This displays correctly when read back into Excel, ie "17-Sep-13". But:

mmmm dd, yyyy: This was written out to the CSV as "September 17, 2013", with quotes, as a character string. But when it was read back into Excel, it was interpreted correctly as a date—and displayed the same as the above, dd-mmm-yy or "17-Sep-13". Again, weird.

mmm-yy and mmmm-yy: These went to the CSV without quotes (as Sep-13 and September-13), so when Excel read them back in it accepted them as dates. But it didn't know that 13 was meant as a year, so it assigned the format dd-mmm and displays them both as "13-Sep".

There are other departures, some of them equally puzzling, but the upshot is this: Your dates are getting out to the CSV as you intend, but when you read the CSV back into Excel, Excel is making up its own mind about how to display them. So all you have to worry about is whether that other application, the destination app, is reading your dates as you intend.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with changing between two template formats juliejames PowerPoint 0 07-26-2013 01:53 AM
CSV Date Formats File Formats ROLLSROYCE Word 1 05-12-2013 05:33 PM
TOC formats ruggb Word 3 03-09-2012 02:07 AM
Template formats ROTECH Outlook 0 07-20-2011 09:28 PM
CSV Date Formats Help With Contracts Formats!! SaintJustin Martyr Word 6 06-20-2011 06:19 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft