View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Fred Smith
 
Posts: n/a
Default 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" wrote in message
...
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?