1

I am looking for a non-ugly way to convert a MUMPS formatted $H ("63868,62327" is 11/12/2015 at 17:18:47) date/time into an Excel 2016 compatible format date/time format. I came up with the following, but it's ugly:

=NUMBERVALUE(NUMBERVALUE(LEFT(A1,(SEARCH(",",A1)-1))-21548) & MID(NUMBERVALUE((1/86400)*MID(A1,(SEARCH(",",A1)+1),5)),2,6))

While this does work, it is definitely ugly. Any ideas?

BruceWayne
  • 22,923
  • 15
  • 65
  • 110

2 Answers2

1

How about:

=LEFT(A1,FIND(",",A1)-1)-21548+ MID(A1,FIND(",",A1)+1,99)/86400
Ron Rosenfeld
  • 53,870
  • 7
  • 28
  • 60
0

Just curious to know if you are able to use $zdt($h) instead of $h on the Caché side. This will do that exact same conversion for you.

Furthermore, if this is a solution, then there are extra parameters to specify the format. The one you asked about is the default: $zdt($h,1,1) or simply $zdt($h).

$zdt has date formats between 1-15 and time formats between 1-10.

This format is as follows:

$zdt([n],[d],[t])

Where n is a mumps formatted number, d is the date format 1-15 and t is the time format 1-10.

MWiesner
  • 8,868
  • 11
  • 36
  • 70
Mike M
  • 21
  • 2
  • Thanks, that's good information on the Cache/Intersystems side of things. I was looking specifically for the $H format as it is stock standard for all MUMPS implementations. – Raymond Subasic Dec 14 '21 at 17:41