Hundred Year Date

G

Guest

Does anyone know how to convert a date to the hundred year date format.
For example, how would i convert 8/11/2004 to its hundred year date format.
Thanks!

Tim
 
R

Raterus

I'm not familiar with the "hundred year date format", What would the end format look like for '8/11/2004' ?
 
L

Lucas Tam

Does anyone know how to convert a date to the hundred year date
format. For example, how would i convert 8/11/2004 to its hundred year
date format. Thanks!


You can use the FormatDateTime or Format function.
 
M

Mark Rae

Does anyone know how to convert a date to the hundred year date format.
For example, how would i convert 8/11/2004 to its hundred year date
format.

"Hundred year format"??? What on earth is that?
 
R

Raterus

I do believe this is what you are after

Dim dt As DateTime = #8/11/2004#
Dim d As Long
d = dt.ToOADate
 
C

Chris Moore

I'm just curious, but does anybody know how 8/11/2004 becomes 38209? What's the basis of this hundred year format?

Chris
--------------------
 
M

mikeb

Chris said:
I'm just curious, but does anybody know how 8/11/2004 becomes 38209? What's the basis of this hundred year format?

It's the number of days since some point near the start of 1900.

See the docs for DateTime.ToOADate().

There may be a bit of discrepancy - the OP said that 8/11/2004 should be
38209.

ToOADate() returns 38210 for that date.
 
Joined
Aug 14, 2007
Messages
1
Reaction score
0
Hey guys, the best way to convert a date to a Hundred-Year format is with the following formula: result = date(datefield + (days((date('1899-12-31')))))
The base date is Dec 31, 1899. the formula works for SQL, Queries, and RPGILE programming languages. I would assume it would still apply to any other programming language, you should follow the specific format for those languages.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top