added function to convert to/from julian representation