18 #ifndef CARMA_UTIL_TIME_H
19 #define CARMA_UTIL_TIME_H
124 static double MJD() ;
165 const std::string& date,
166 const std::string& format=
"%Y %b %d %H:%M:%S",
236 const std::string& date,
237 const std::string& format=
"%Y %b %d %H:%M:%S",
242 static double computeMJD1(
243 const std::string& date,
244 const std::string& format=
"%Y %b %d %H:%M:%S",
264 static double timeval2MJD (
const struct ::timeval & abstimeval);
290 static std::string
getTimeString(
double mjd,
int precision=0) ;
309 const std::string &dateFormat =
"%d%b%y") ;
318 const std::string &dateFormat =
"%d%b%y") ;
327 const std::string &dateFormat =
"%d%b%y") ;
336 const std::string &dateFormat =
"%d%b%y") ;
373 double mjd, const ::std::string &dateFormat );
384 const std::string &dateFormat =
"%d%b%y") ;
398 const std::string &dateFormat =
"%d%b%y") ;
412 const std::string &dateFormat =
"%d%b%y") ;
453 const std::string &format,
469 const time_t secondsSince1970);
521 static double get2kd() ;
522 static int computeIntegerMJD(double mjd, int precision=0) ;
523 static double roundMJD(double mjd, int precision=0) ;
554 ::std::ostream& operator<<( ::std::ostream& os,
555 const carma::util::Time& time );
static int diffHrsFromGmt(const struct tm myTime, const time_t secondsSince1970)
Utility for obtaining GMT from a local time with faster performance.
static const double JD2000
The JD (Julian Data) for 2000.0 as a convenience.
virtual ~Time()
Destructor.
static std::string getFITSdateTimeString(int precision=0)
Get FITS style date and time of day string for current time.
TimeZone
enumeration for defining timezones
static frameType computeFrame(double mjd)
Get integral half-second frame since 2000 for requested time, rounded down.
static const double MILLISECONDS_PER_DAY
The number of microseconds per day.
unsigned int frameType
Half second frames since Jan 1, 2000.
static double computeTimeToNextFrame(double delay=0)
Get time to next frame (half-second) with a delay after the frame.
static std::string getDateString(const std::string &dateFormat="%d%b%y")
Get date string for current time.
static double timespec2MJD(const struct timespec ts)
Converts absolute time specified as a ::timespec to an MJD.
static const double FRAMES_PER_DAY
The number of half-second frames per day.
static time_t gettime_t(const frameType frame)
Converts a frame number to a time_t in UTC.
static const double MJD2000
The MJD for 2000.0.
static frameType computeCurrentFrame()
Get integral half-second frame since 2000, rounded down.
static std::string getDateTimeString(int precision=0, const std::string &dateFormat="%d%b%y")
Get date and time of day string for current time.
static const double MJD1970
The MJD for 1970.0.
static std::string getTimeString(int precision=0)
Get time of day string for current time.
static const double MINUTES_PER_DAY
The number of minutes per day.
This class deals primarily with Frames and Times.
Time()
Default constructor.
static frameType computeClosestFrame()
Get integral half-second frame that is closest to current time.
static double computeFrameTimeDiff(frameType frame, double delay=0)
Get time difference of current time to the delayed frame.
::std::string getNonBuggyByDesignDateTimeString(double mjd, const ::std::string &dateFormat)
Get date and time of day string for current time.
static const double SECONDS_PER_DAY
The number of seconds per day.
static const double MICROSECONDS_PER_DAY
The number of milliseconds per day.
static struct tm getGmtFromLmt(const std::string &date, const std::string &format, const Time::TimeZone tz)
Utility for obtaining GMT from a local time Note:This is expensive.
double getStoredMJD() const
Return stored MJD.
static double computeTimeToFrame(frameType frame, double delay=0)
Get time from now to a specific frame with a delay after the frame.
static double MJD()
Get current MJD.
Various type definitions for util classes.
static double timeval2MJD(const struct::timeval &abstimeval)
Converts absolute time specified as a ::timeval to an MJD.
static double computeMJD(time_t seconds)
Compute the MJD of the Unix-style seconds since 1970.
static std::string getFITSdateString()
Get date string for current time in FITS notation.