Method: DateTime#ajd

Defined in:
ext/date_ext/datetime.c

#ajdFloat

Returns the date and time represented by the receiver as a astronomical julian day Float.

Returns:

  • (Float)


1013
1014
1015
1016
1017
1018
1019
# File 'ext/date_ext/datetime.c', line 1013

static VALUE rhrdt_ajd(VALUE self) {
  rhrdt_t *d;
  Data_Get_Struct(self, rhrdt_t, d);
  RHRDT_FILL_JD(d)
  RHRDT_FILL_NANOS(d)
  return rb_float_new(d->jd + (double)d->nanos/RHR_NANOS_PER_DAYD - d->offset/1440.0 - 0.5);
}