# Converting Julian Seconds with a macro to replace old seconds data

1. ## Converting Julian Seconds with a macro to replace old seconds data

I have just recently converted an access database to excel and in the data is
some fields with the date/time stored as julian seconds. In access I used to
just use a macro to convert and display it on a form, but I can no longer do
that.

I just wish to convert the data to a mm/dd/yyyy format, but I am unsure how
to with excel.

This is the function.

Function JulianSecondsToDateTime(IngJulianSeconds As Long) As Date

'Julian Seconds plus 68 years to make compatible with Access
JulianSecondsToDateTime = DateAdd("yyyy", 68, CDate(IngJulianSeconds / 86400))

End Function

Is there a way to do so?

2. ## Re: Converting Julian Seconds with a macro to replace old seconds data

One way to apply the same conversion as your Access function is:

=date(year(a1/86400)+68,month(a1/86400),day(a1/86400))

Does this help?

--
Regards,
Fred

"Keldair" <Keldair@discussions.microsoft.com> wrote in message
news:A4F115C1-76F1-445B-8919-639A947DD872@microsoft.com...
>I have just recently converted an access database to excel and in the data is
> some fields with the date/time stored as julian seconds. In access I used to
> just use a macro to convert and display it on a form, but I can no longer do
> that.
>
> I just wish to convert the data to a mm/dd/yyyy format, but I am unsure how
> to with excel.
>
> This is the function.
>
> Function JulianSecondsToDateTime(IngJulianSeconds As Long) As Date
>
> 'Julian Seconds plus 68 years to make compatible with Access
> JulianSecondsToDateTime = DateAdd("yyyy", 68, CDate(IngJulianSeconds / 86400))
>
> End Function
>
> Is there a way to do so?

3. ## Re: Converting Julian Seconds with a macro to replace old seconds

Yes that helps, thank you much.

"Fred Smith" wrote:

> One way to apply the same conversion as your Access function is:
>
> =date(year(a1/86400)+68,month(a1/86400),day(a1/86400))
>
> Does this help?
>
> --
> Regards,
> Fred
>
>
> "Keldair" <Keldair@discussions.microsoft.com> wrote in message
> news:A4F115C1-76F1-445B-8919-639A947DD872@microsoft.com...
> >I have just recently converted an access database to excel and in the data is
> > some fields with the date/time stored as julian seconds. In access I used to
> > just use a macro to convert and display it on a form, but I can no longer do
> > that.
> >
> > I just wish to convert the data to a mm/dd/yyyy format, but I am unsure how
> > to with excel.
> >
> > This is the function.
> >
> > Function JulianSecondsToDateTime(IngJulianSeconds As Long) As Date
> >
> > 'Julian Seconds plus 68 years to make compatible with Access
> > JulianSecondsToDateTime = DateAdd("yyyy", 68, CDate(IngJulianSeconds / 86400))
> >
> > End Function
> >
> > Is there a way to do so?

>
>
>

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1