469,646 Members | 1,596 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

Converting OLE Automation Dates back into regular date/time?

I'm using "Now.ToOADate" for a record timestamp in a small database app
(it's what I want to do so don't try to disuade me ;-D).

Anyway. I store the value of Now.ToOADate in a string field in the
database (16 character field on a SQL server to be exact). Is there a
way of converting the text value from that field back into a readable
date/time?

For example if a date is stored in the 16 character field as the OLE
Automation format "38876.4941902894" then what do I need to do to work
it backward to get a regular date/time format (i.e. human readable) in
my VB.Net application?

I've been Googling for the technique but I don't know how to word my
search query so I haven't found anything useful.

Jun 8 '06 #1
2 6584
To**********@gmail.com wrote:
Anyway. I store the value of Now.ToOADate in a string field in the
database (16 character field on a SQL server to be exact). Is there a
way of converting the text value from that field back into a readable
date/time?


\\\
newDate = DateTime.FromOADate(CDbl(yourString))
///

HTH,

--

(O)enone
Jun 8 '06 #2

Oenone wrote:
To**********@gmail.com wrote:
Anyway. I store the value of Now.ToOADate in a string field in the
database (16 character field on a SQL server to be exact). Is there a
way of converting the text value from that field back into a readable
date/time?


\\\
newDate = DateTime.FromOADate(CDbl(yourString))
///

HTH,

--

(O)enone


HAHA I was just coming back to say "NM" I found a reference to the
FromOADate() in another post and looked it up. So dteStoredDate =
DateTime.FromOADate(strStoredDate) worked like a charm!

Thanks (O)enone!

Jun 8 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Amy G | last post: by
2 posts views Thread by Chermside, Michael | last post: by
3 posts views Thread by Jef Driesen | last post: by
11 posts views Thread by Keith Hughitt | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.