Learn R Programming

RSEIS (version 2.1-6)

recdate: Rectify Date

Description

Rectify a date that may be out of wack.

Usage

recdate(jd=0, hr=0, mi=0, sec=0, yr=0)
recdatel(X)

Arguments

jd
Julian Day
hr
hours
mi
minutes
sec
seconds
yr
year
X
list of date

Value

  • jdJulian Day
  • hrhours
  • miminutes
  • secseconds
  • yryear

Details

Returns date with correct numbers. So if number of seconds is greater than 60, will add to minutes...

See Also

showdatetime, DAYSperYEAR, fromjul,getjul, tojul, getmoday

Examples

Run this code
recdate(76, 23, 22, yr=2000)

###########  example spanning leap year
##  start on Day 1, but subtract 36 hours and proceed to plus 36 hours
hrs = seq(from=-36, to=36, by=2)
rd = recdate(jd=1, hr=hrs, mi=34, sec=23+runif(n=length(hrs), 0, 59) , yr=2009)
write.table(data.frame(rd))

###########  example spanning non-leap year
rd2 = recdate(jd=1, hr=hrs, mi=34, sec=23+runif(n=length(hrs), 0, 59) , yr=2008)
write.table(data.frame(rd2))

Run the code above in your browser using DataLab