52 #ifndef __PCL_TimePoint_h
53 #define __PCL_TimePoint_h
118 , m_jdf(
Frac( jd ) )
135 , m_jdf(
Frac( jd1 ) +
Frac( jd2 ) )
152 TimePoint(
int year,
int month,
int day,
double dayFraction )
160 TimePoint(
int year,
int month,
int day,
int hour,
int minute,
double seconds )
162 CalendarTimeToJD( m_jdi, m_jdf, year, month, day, (hour + (minute + seconds/60)/60)/24 );
176 int year, month, day;
193 int year, month, day;
233 return ((m_jdi > 0) ? m_jdi : -m_jdi) < 2147438065;
297 void GetCalendarTime(
int& year,
int& month,
int& day,
int& hour,
int& minute,
double& seconds )
const
301 double h =
Frac( dayf )*24;
302 double m =
Frac( h )*60;
303 seconds =
Frac( m )*60;
313 int year, foo;
double bar;
323 int foo, month;
double bar;
333 int foo, day;
double bar;
343 int foobar;
double dayf;
364 return ToString( options, tz, (
String*)0 );
393 String ToString(
unsigned timeItems,
unsigned precision = 3,
double tz = 0,
bool timeZone =
true,
bool zuluTime =
true )
const
414 return ToString( options, tz, (
IsoString*)0 );
443 IsoString ToIsoString(
unsigned timeItems,
unsigned precision = 3,
double tz = 0,
bool timeZone =
true,
bool zuluTime =
true )
const
532 IsoString ToIsoString(
const char* format )
const
534 return ToIsoString(
IsoString( format ) );
550 return ToIsoString();
566 constexpr
double JDF()
const
583 constexpr
double JD()
const
585 return m_jdi + m_jdf;
594 constexpr
double MJD()
const
596 return (m_jdi-2400000) + (m_jdf-0.5);
616 double DeltaT()
const;
635 double DeltaAT()
const;
665 return m_jdi-t.m_jdi + m_jdf-t.m_jdf;
674 return DaysSince( t )/365.25;
683 return DaysSince( t )/36525;
692 return DaysSince( t )*86400;
701 return DaysSinceJ2000();
711 return YearsSinceJ2000();
721 return CenturiesSinceJ2000();
730 return SecondsSinceJ2000();
739 return m_jdi-2451545 + m_jdf;
748 return DaysSinceJ2000()/365.25;
757 return DaysSinceJ2000()/36525;
766 return DaysSinceJ2000()*86400;
775 return m_jdi-2440587 + m_jdf-0.5;
784 return DaysSinceUNIXEpoch()/365.25;
793 return DaysSinceUNIXEpoch()/36525;
802 return DaysSinceUNIXEpoch()*86400;
811 return DaysSinceUNIXEpoch()*86400000;
820 double SystemOffsetFromUTC()
const;
828 return TimePoint( m_jdi, m_jdf + SystemOffsetFromUTC()/24 );
837 return TimePoint( m_jdi, m_jdf - SystemOffsetFromUTC()/24 );
888 t.m_jdf = 0.42345905;
921 int year, month, day;
924 return TimePoint( year, month, day, dayf - tz/24 );
944 int year, month, day;
947 return TimePoint( year, month, day, dayf - tz/24 );
1004 int year, month, day;
1008 t =
TimePoint( year, month, day, dayf - tz/24 );
1034 int year, month, day;
1038 t =
TimePoint( year, month, day, dayf - tz/24 );
1064 return TryFromString( t, tz, dateTime );
1087 return TryFromString( t, tz, dateTime );
1104 m_jdf =
Frac( m_jdf );
1114 else if ( m_jdi < 0 )
1122 S ToString(
const ISO8601ConversionOptions& options,
double tz, S* )
const
1126 int year, month, day;
1129 return S::ToISO8601DateTime( year, month, day, dayf, tz, options );
1140 struct PCL_AssertTimePointSize
1143 static_assert(
sizeof( TimePoint ) ==
sizeof( TestData ),
"Invalid sizeof( TimePoint )" );
1163 return t1.
JD() == jd2;
1174 return t2.
JD() == jd1;
1267 #endif // __PCL_TimePoint_h