Learn R Programming

cwhmisc (version 6.0)

Julian date: calender conversions

Description

calender conversions, Julian day number from civil date and back, names of months, weekdays.

Usage

Dat2Jul( yr, mo, dy, hr=12 )
  Jul2Dat( JD )
  monthsN( leap )
  Mnames
  Dnames
  mdiny( dk, leap )
  Wday( JD )
  Yday( mo, dy, leap )

Arguments

yr, mo, dy
integer, year, month, day of date
hr, JD
real, hrs, Julian date
leap
Boolean, = is concerning year a leap year ?
dk
Integer

Value

  • Dat2Jul: JD, year Y BC is to be given as -|Y-1|, e.g. 4 BC = -3 !! Jul2Dat: date ( year, month, day, hours ). monthsN: cumulative sum of days in months. Mnames: names of months. Dnames: names of weekdays. mdiny: c( number of month, day in (leap) year ). Wday: name of weekday from dk mod 7. Yday: number of day, from 0 = Jan 1.

Examples

Run this code
Dat2Jul(-4712,01,01)  # =     0  i.e. Start of Julian day numbering
 Jul2Dat( 0 )          #  -4712    1    1   12
 formatFix(Dat2Jul(c(1582,10,4,23+59/60)),8,10) # 2299160.499.. = last day of Julian calendar
 Jul2Dat( 2299160 )          # 1582  10  4   12
 Dat2Jul(c(2000,3,2))   # 2451606
 Jul2Dat(2451606.0)    # 2000    3    2   12
 mdiny(1,TRUE)    #  1 1
 mdiny(60,TRUE)   #  2 29

Run the code above in your browser using DataLab