I am working with a tps file where the date they use is something like
75736. This number is the number of days since December 28,1800. I
know how to get this number with the code below

Dim d As DateTime = New DateTime(1800, 12, 28)
MsgBox(DateTime.Today.Subtract(d).Days()) 'returns 75736 on
5/7/08.


However, how can i convert the 75736 to 5/6/2008? Thank you for your
help

Re: Date converison by Lloyd

Lloyd
Wed May 07 09:33:59 CDT 2008


"id10t error" <tubbz151@gmail.com> wrote in message
news:58985217-dd9e-4387-b729-b398c197f214@2g2000hsn.googlegroups.com...
>I am working with a tps file where the date they use is something like
> 75736. This number is the number of days since December 28,1800. I
> know how to get this number with the code below
>
> Dim d As DateTime = New DateTime(1800, 12, 28)
> MsgBox(DateTime.Today.Subtract(d).Days()) 'returns 75736 on
> 5/7/08.
>
>
> However, how can i convert the 75736 to 5/6/2008? Thank you for your
> help

d.AddDays(75736) will give you todays date.

LS


Re: Date converison by Armin

Armin
Wed May 07 09:36:44 CDT 2008

"id10t error" <tubbz151@gmail.com> schrieb
> I am working with a tps file where the date they use is something
> like 75736. This number is the number of days since December
> 28,1800. I know how to get this number with the code below
>
> Dim d As DateTime = New DateTime(1800, 12, 28)
> MsgBox(DateTime.Today.Subtract(d).Days()) 'returns 75736 on
> 5/7/08.
>
>
> However, how can i convert the 75736 to 5/6/2008? Thank you for your
> help

I guess "convert" means "calculate":

Dim d As Date
d = #12/28/1800#.AddDays(75736)

If needed, you can pass a format string to d.ToString


Armin

RE: Date converison by AMercer

AMercer
Wed May 07 09:40:01 CDT 2008

Dim dt0 As New DateTime(1800, 12, 28)
Dim dt1 As DateTime = dt0.AddDays(75736)

dt1 is 5/7/2008. I assume your '5/6/2008' is a typo.


"id10t error" wrote:

> I am working with a tps file where the date they use is something like
> 75736. This number is the number of days since December 28,1800. I
> know how to get this number with the code below
>
> Dim d As DateTime = New DateTime(1800, 12, 28)
> MsgBox(DateTime.Today.Subtract(d).Days()) 'returns 75736 on
> 5/7/08.
>
>
> However, how can i convert the 75736 to 5/6/2008? Thank you for your
> help
>

Re: Date converison by id10t

id10t
Wed May 07 13:31:49 CDT 2008

On May 7, 10:40=A0am, AMercer <AMer...@discussions.microsoft.com> wrote:
> =A0 =A0 =A0 Dim dt0 As New DateTime(1800, 12, 28)
> =A0 =A0 =A0 Dim dt1 As DateTime =3D dt0.AddDays(75736)
>
> dt1 is 5/7/2008. =A0I assume your '5/6/2008' is a typo.
>
>
>
> "id10t error" wrote:
> > I am working with a tps file where the date they use is something like
> > 75736. This number is the number of days since December 28,1800. =A0I
> > know how to get this number with the code below
>
> > =A0 =A0 =A0 =A0 =A0 Dim d As DateTime =3D New DateTime(1800, 12, 28)
> > =A0 =A0 =A0 =A0 MsgBox(DateTime.Today.Subtract(d).Days()) 'returns 75736=
on
> > 5/7/08.
>
> > However, how can i convert the 75736 to 5/6/2008? Thank you for your
> > help- Hide quoted text -
>
> - Show quoted text -

Yes it was a typo. Thank you for your help it worked great.