Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

C#, ie 7.0, string format

Posted on 2007-08-06
3
Medium Priority
?
186 Views
Last Modified: 2013-12-17
I have created a datatable from a excel document.  I have a date that is reading in a number value like this 38718.  I need that value to be a small date value and converted into a string.  The tostring() method does not accomplish this
0
Comment
Question by:TroyCrowe
  • 2
3 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 19641221
Did you try the tostring with a formatting ?
d.tostring("yyyymmdd")
0
 
LVL 25

Accepted Solution

by:
dstanley9 earned 375 total points
ID: 19641231
You can use FromOADate to convert from OLE-Automation dates (which is what Excel uses) to .NET dates:

string strDate = DateTime.FromOADate(38718).ToString();
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 19789432
Can you give some feedback if it one of the answer was sufficient or do you still have any problems ?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question