3 #ifndef __EPICSTIMEHELPER_H__
4 #define __EPICSTIMEHELPER_H__
9 #include "tools/ToolsConfig.h"
34 static bool parse(
const stdString &t,
double &n,
double default_factor=1.0);
39 static stdString
format(
double seconds);
43 extern const epicsTime nullTime;
46 bool isValidTime(
const epicsTime &t);
57 bool string2epicsTime(
const stdString &txt, epicsTime &time);
64 bool epicsTime2string(
const epicsTime &time, stdString &txt);
67 const char *epicsTimeTxt(
const epicsTime &time, stdString &txt);
80 void epicsTime2vals(
const epicsTime &time,
81 int &year,
int &month,
int &day,
82 int &hour,
int &min,
int &sec,
unsigned long &nano);
85 void vals2epicsTime(
int year,
int month,
int day,
86 int hour,
int min,
int sec,
unsigned long nano,
91 #define secsPerMinute 60
92 #define secsPerHour (60*60)
93 #define secsPerDay (60*60*24)
94 #define secsPerMonth (60*60*24*31)
95 #define secsPerYear (60*60*24*31*365)
98 epicsTime roundTime (
const epicsTime &time,
double secs);
101 epicsTime roundTimeUp (
const epicsTime &time,
double secs);
104 epicsTime roundTimeDown (
const epicsTime &time,
double secs);
108 #endif //__EPICSTIMEHELPER_H__
Parse seconds from text, and format seconds into text.
Definition: epicsTimeHelper.h:20
static bool parse(const stdString &t, double &n, double default_factor=1.0)
Parse text into number.
static stdString format(double seconds)