PCL
TimePoint.h
Go to the documentation of this file.
1 // ____ ______ __
2 // / __ \ / ____// /
3 // / /_/ // / / /
4 // / ____// /___ / /___ PixInsight Class Library
5 // /_/ \____//_____/ PCL 2.6.5
6 // ----------------------------------------------------------------------------
7 // pcl/TimePoint.h - Released 2024-01-13T15:47:58Z
8 // ----------------------------------------------------------------------------
9 // This file is part of the PixInsight Class Library (PCL).
10 // PCL is a multiplatform C++ framework for development of PixInsight modules.
11 //
12 // Copyright (c) 2003-2024 Pleiades Astrophoto S.L. All Rights Reserved.
13 //
14 // Redistribution and use in both source and binary forms, with or without
15 // modification, is permitted provided that the following conditions are met:
16 //
17 // 1. All redistributions of source code must retain the above copyright
18 // notice, this list of conditions and the following disclaimer.
19 //
20 // 2. All redistributions in binary form must reproduce the above copyright
21 // notice, this list of conditions and the following disclaimer in the
22 // documentation and/or other materials provided with the distribution.
23 //
24 // 3. Neither the names "PixInsight" and "Pleiades Astrophoto", nor the names
25 // of their contributors, may be used to endorse or promote products derived
26 // from this software without specific prior written permission. For written
27 // permission, please contact info@pixinsight.com.
28 //
29 // 4. All products derived from this software, in any form whatsoever, must
30 // reproduce the following acknowledgment in the end-user documentation
31 // and/or other materials provided with the product:
32 //
33 // "This product is based on software from the PixInsight project, developed
34 // by Pleiades Astrophoto and its contributors (https://pixinsight.com/)."
35 //
36 // Alternatively, if that is where third-party acknowledgments normally
37 // appear, this acknowledgment must be reproduced in the product itself.
38 //
39 // THIS SOFTWARE IS PROVIDED BY PLEIADES ASTROPHOTO AND ITS CONTRIBUTORS
40 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
41 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PLEIADES ASTROPHOTO OR ITS
43 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44 // EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, BUSINESS
45 // INTERRUPTION; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; AND LOSS OF USE,
46 // DATA OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
47 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49 // POSSIBILITY OF SUCH DAMAGE.
50 // ----------------------------------------------------------------------------
51 
52 #ifndef __PCL_TimePoint_h
53 #define __PCL_TimePoint_h
54 
56 
57 #include <pcl/Defs.h>
58 
59 #include <pcl/Math.h>
60 #include <pcl/String.h>
61 
62 /*
63  * N.B.: Remove potentially conflicting names that may be defined by 3rd-party
64  * packages used by some standard modules.
65  */
66 #ifdef J2000
67 # undef J2000
68 #endif
69 #ifdef J2100
70 # undef J2100
71 #endif
72 #ifdef B1950
73 # undef B1950
74 #endif
75 
76 namespace pcl
77 {
78 
79 // ----------------------------------------------------------------------------
80 
85 // ----------------------------------------------------------------------------
86 
87 struct FileTime;
88 
102 class PCL_CLASS TimePoint
103 {
104 public:
105 
110  TimePoint() = default;
111 
116  TimePoint( double jd )
117  : m_jdi( TruncInt( jd ) )
118  , m_jdf( Frac( jd ) )
119  {
120  }
121 
133  TimePoint( double jd1, double jd2 )
134  : m_jdi( TruncInt( jd1 ) + TruncInt( jd2 ) )
135  , m_jdf( Frac( jd1 ) + Frac( jd2 ) )
136  {
137  Normalize();
138  }
139 
143  TimePoint( int year, int month, double days )
144  {
145  CalendarTimeToJD( m_jdi, m_jdf, year, month, TruncInt( days ), Frac( days ) );
146  }
147 
152  TimePoint( int year, int month, int day, double dayFraction )
153  {
154  CalendarTimeToJD( m_jdi, m_jdf, year, month, day, dayFraction );
155  }
156 
160  TimePoint( int year, int month, int day, int hour, int minute, double seconds )
161  {
162  CalendarTimeToJD( m_jdi, m_jdf, year, month, day, (hour + (minute + seconds/60)/60)/24 );
163  }
164 
174  TimePoint( const IsoString& dateTime )
175  {
176  int year, month, day;
177  double dayf, tz;
178  dateTime.ParseISO8601DateTime( year, month, day, dayf, tz );
179  CalendarTimeToJD( m_jdi, m_jdf, year, month, day, dayf - tz/24 );
180  }
181 
191  TimePoint( const String& dateTime )
192  {
193  int year, month, day;
194  double dayf, tz;
195  dateTime.ParseISO8601DateTime( year, month, day, dayf, tz );
196  CalendarTimeToJD( m_jdi, m_jdf, year, month, day, dayf - tz/24 );
197  }
198 
203  TimePoint( time_t time );
204 
214  TimePoint( const FileTime& fileTime );
215 
219  TimePoint( const TimePoint& ) = default;
220 
224  TimePoint& operator =( const TimePoint& ) = default;
225 
231  constexpr bool IsValid() const
232  {
233  return ((m_jdi > 0) ? m_jdi : -m_jdi) < 2147438065;
234  }
235 
248  void GetCalendarTime( int& year, int& month, int& day ) const
249  {
250  double dum;
251  JDToCalendarTime( year, month, day, dum, m_jdi, m_jdf );
252  }
253 
270  void GetCalendarTime( int& year, int& month, int& day, double& dayf ) const
271  {
272  JDToCalendarTime( year, month, day, dayf, m_jdi, m_jdf );
273  }
274 
297  void GetCalendarTime( int& year, int& month, int& day, int& hour, int& minute, double& seconds ) const
298  {
299  double dayf;
300  JDToCalendarTime( year, month, day, dayf, m_jdi, m_jdf );
301  double h = Frac( dayf )*24;
302  double m = Frac( h )*60;
303  seconds = Frac( m )*60;
304  minute = TruncInt( m );
305  hour = TruncInt( h );
306  }
307 
311  int Year() const
312  {
313  int year, foo; double bar;
314  JDToCalendarTime( year, foo, foo, bar, m_jdi, m_jdf );
315  return year;
316  }
317 
321  int Month() const
322  {
323  int foo, month; double bar;
324  JDToCalendarTime( foo, month, foo, bar, m_jdi, m_jdf );
325  return month;
326  }
327 
331  int Day() const
332  {
333  int foo, day; double bar;
334  JDToCalendarTime( foo, foo, day, bar, m_jdi, m_jdf );
335  return day;
336  }
337 
341  double DayFraction() const
342  {
343  int foobar; double dayf;
344  JDToCalendarTime( foobar, foobar, foobar, dayf, m_jdi, m_jdf );
345  return dayf;
346  }
347 
362  String ToString( const ISO8601ConversionOptions& options = ISO8601ConversionOptions(), double tz = 0 ) const
363  {
364  return ToString( options, tz, (String*)0 );
365  }
366 
393  String ToString( unsigned timeItems, unsigned precision = 3, double tz = 0, bool timeZone = true, bool zuluTime = true ) const
394  {
395  return ToString( ISO8601ConversionOptions( timeItems, precision, timeZone, zuluTime ), tz );
396  }
397 
412  IsoString ToIsoString( const ISO8601ConversionOptions& options = ISO8601ConversionOptions(), double tz = 0 ) const
413  {
414  return ToString( options, tz, (IsoString*)0 );
415  }
416 
443  IsoString ToIsoString( unsigned timeItems, unsigned precision = 3, double tz = 0, bool timeZone = true, bool zuluTime = true ) const
444  {
445  return ToIsoString( ISO8601ConversionOptions( timeItems, precision, timeZone, zuluTime ), tz );
446  }
447 
518  String ToString( const String& format ) const;
519 
530  IsoString ToIsoString( const IsoString& format ) const;
531 
532  IsoString ToIsoString( const char* format ) const
533  {
534  return ToIsoString( IsoString( format ) );
535  }
536 
540  explicit operator String() const
541  {
542  return ToString();
543  }
544 
548  explicit operator IsoString() const
549  {
550  return ToIsoString();
551  }
552 
557  constexpr int JDI() const
558  {
559  return m_jdi;
560  }
561 
566  constexpr double JDF() const
567  {
568  return m_jdf;
569  }
570 
583  constexpr double JD() const
584  {
585  return m_jdi + m_jdf;
586  }
587 
594  constexpr double MJD() const
595  {
596  return (m_jdi-2400000) + (m_jdf-0.5);
597  }
598 
616  double DeltaT() const;
617 
635  double DeltaAT() const;
636 
641  TimePoint& operator +=( double days )
642  {
643  m_jdf += days;
644  Normalize();
645  return *this;
646  }
647 
652  TimePoint& operator -=( double days )
653  {
654  m_jdf -= days;
655  Normalize();
656  return *this;
657  }
658 
663  constexpr double DaysSince( const TimePoint& t ) const
664  {
665  return m_jdi-t.m_jdi + m_jdf-t.m_jdf;
666  }
667 
672  constexpr double YearsSince( const TimePoint& t ) const
673  {
674  return DaysSince( t )/365.25;
675  }
676 
681  constexpr double CenturiesSince( const TimePoint& t ) const
682  {
683  return DaysSince( t )/36525;
684  }
685 
690  constexpr double SecondsSince( const TimePoint& t ) const
691  {
692  return DaysSince( t )*86400;
693  }
694 
699  constexpr double DaysSinceReferenceEpoch() const
700  {
701  return DaysSinceJ2000();
702  }
703 
709  constexpr double YearsSinceReferenceEpoch() const
710  {
711  return YearsSinceJ2000();
712  }
713 
719  constexpr double CenturiesSinceReferenceEpoch() const
720  {
721  return CenturiesSinceJ2000();
722  }
723 
728  constexpr double SecondsSinceReferenceEpoch() const
729  {
730  return SecondsSinceJ2000();
731  }
732 
737  constexpr double DaysSinceJ2000() const
738  {
739  return m_jdi-2451545 + m_jdf;
740  }
741 
746  constexpr double YearsSinceJ2000() const
747  {
748  return DaysSinceJ2000()/365.25;
749  }
750 
755  constexpr double CenturiesSinceJ2000() const
756  {
757  return DaysSinceJ2000()/36525;
758  }
759 
764  constexpr double SecondsSinceJ2000() const
765  {
766  return DaysSinceJ2000()*86400;
767  }
768 
773  constexpr double DaysSinceUNIXEpoch() const
774  {
775  return m_jdi-2440587 + m_jdf-0.5;
776  }
777 
782  constexpr double YearsSinceUNIXEpoch() const
783  {
784  return DaysSinceUNIXEpoch()/365.25;
785  }
786 
791  constexpr double CenturiesSinceUNIXEpoch() const
792  {
793  return DaysSinceUNIXEpoch()/36525;
794  }
795 
800  constexpr double SecondsSinceUNIXEpoch() const
801  {
802  return DaysSinceUNIXEpoch()*86400;
803  }
804 
809  constexpr double MillisecondsSinceUNIXEpoch() const
810  {
811  return DaysSinceUNIXEpoch()*86400000;
812  }
813 
820  double SystemOffsetFromUTC() const;
821 
827  {
828  return TimePoint( m_jdi, m_jdf + SystemOffsetFromUTC()/24 );
829  }
830 
836  {
837  return TimePoint( m_jdi, m_jdf - SystemOffsetFromUTC()/24 );
838  }
839 
844  static TimePoint Now();
845 
852  {
853  return J2000();
854  }
855 
860  static TimePoint J2000()
861  {
862  TimePoint t;
863  t.m_jdi = 2451545;
864  t.m_jdf = 0;
865  return t;
866  }
867 
872  static TimePoint J2100()
873  {
874  TimePoint t;
875  t.m_jdi = 2488070;
876  t.m_jdf = 0;
877  return t;
878  }
879 
884  static TimePoint B1950()
885  {
886  TimePoint t;
887  t.m_jdi = 2433282;
888  t.m_jdf = 0.42345905;
889  return t;
890  }
891 
897  {
898  TimePoint t;
899  t.m_jdi = 2440587;
900  t.m_jdf = 0.5;
901  return t;
902  }
903 
919  static TimePoint FromString( double& tz, const IsoString& dateTime )
920  {
921  int year, month, day;
922  double dayf;
923  dateTime.ParseISO8601DateTime( year, month, day, dayf, tz );
924  return TimePoint( year, month, day, dayf - tz/24 );
925  }
926 
942  static TimePoint FromString( double& tz, const String& dateTime )
943  {
944  int year, month, day;
945  double dayf;
946  dateTime.ParseISO8601DateTime( year, month, day, dayf, tz );
947  return TimePoint( year, month, day, dayf - tz/24 );
948  }
949 
962  static TimePoint FromString( const IsoString& dateTime )
963  {
964  return TimePoint( dateTime );
965  }
966 
979  static TimePoint FromString( const String& dateTime )
980  {
981  return TimePoint( dateTime );
982  }
983 
1002  static bool TryFromString( TimePoint& t, double& tz, const IsoString& dateTime )
1003  {
1004  int year, month, day;
1005  double dayf;
1006  if ( dateTime.TryParseISO8601DateTime( year, month, day, dayf, tz ) )
1007  {
1008  t = TimePoint( year, month, day, dayf - tz/24 );
1009  return true;
1010  }
1011  return false;
1012  }
1013 
1032  static bool TryFromString( TimePoint& t, double& tz, const String& dateTime )
1033  {
1034  int year, month, day;
1035  double dayf;
1036  if ( dateTime.TryParseISO8601DateTime( year, month, day, dayf, tz ) )
1037  {
1038  t = TimePoint( year, month, day, dayf - tz/24 );
1039  return true;
1040  }
1041  return false;
1042  }
1043 
1061  static bool TryFromString( TimePoint& t, const IsoString& dateTime )
1062  {
1063  double tz;
1064  return TryFromString( t, tz, dateTime );
1065  }
1066 
1084  static bool TryFromString( TimePoint& t, const String& dateTime )
1085  {
1086  double tz;
1087  return TryFromString( t, tz, dateTime );
1088  }
1089 
1090 private:
1091 
1092  int32 m_jdi = int32_max; // invalid by default
1093  double m_jdf = 0.0;
1094 
1101  void Normalize()
1102  {
1103  m_jdi += TruncInt( m_jdf );
1104  m_jdf = Frac( m_jdf );
1105  if ( m_jdf != 0 )
1106  if ( m_jdf < 0 )
1107  {
1108  if ( m_jdi > 0 )
1109  {
1110  --m_jdi;
1111  m_jdf += 1;
1112  }
1113  }
1114  else if ( m_jdi < 0 )
1115  {
1116  ++m_jdi;
1117  m_jdf -= 1;
1118  }
1119  }
1120 
1121  template <class S>
1122  S ToString( const ISO8601ConversionOptions& options, double tz, S* ) const
1123  {
1124  if ( IsValid() )
1125  {
1126  int year, month, day;
1127  double dayf;
1128  JDToCalendarTime( year, month, day, dayf, m_jdi, m_jdf );
1129  return S::ToISO8601DateTime( year, month, day, dayf, tz, options );
1130  }
1131  return S();
1132  }
1133 };
1134 
1135 /*
1136  * ### N.B.: TimePoint cannot have virtual member functions.
1137  * This is because sizeof( TimePoint ) _must_ be equal to
1138  * sizeof( uint32 ) + sizeof( uint64 ).
1139  */
1140 struct PCL_AssertTimePointSize
1141 {
1142  struct TestData { uint32 x; uint64 y; };
1143  static_assert( sizeof( TimePoint ) == sizeof( TestData ), "Invalid sizeof( TimePoint )" );
1144 };
1145 
1151 inline constexpr bool operator ==( const TimePoint& t1, const TimePoint& t2 )
1152 {
1153  return t1.JDI() == t2.JDI() && t1.JDF() == t2.JDF();
1154 }
1155 
1161 inline constexpr bool operator ==( const TimePoint& t1, double jd2 )
1162 {
1163  return t1.JD() == jd2;
1164 }
1165 
1172 inline constexpr bool operator ==( double jd1, const TimePoint& t2 )
1173 {
1174  return t2.JD() == jd1;
1175 }
1176 
1187 inline constexpr bool operator <( const TimePoint& t1, const TimePoint& t2 )
1188 {
1189  return !t1.IsValid() || t2.IsValid() && ((t1.JDI() != t2.JDI()) ? t1.JDI() < t2.JDI() : t1.JDF() < t2.JDF());
1190 }
1191 
1201 inline constexpr bool operator <( const TimePoint& t1, double jd2 )
1202 {
1203  return !t1.IsValid() || t1.JD() < jd2;
1204 }
1205 
1215 inline constexpr bool operator <( double jd1, const TimePoint& t2 )
1216 {
1217  return t2.IsValid() && t2.JD() < jd1;
1218 }
1219 
1226 inline constexpr double operator -( const TimePoint& t1, const TimePoint& t2 )
1227 {
1228  return (t1.JDI() - t2.JDI()) + (t1.JDF() - t2.JDF());
1229 }
1230 
1236 inline TimePoint operator +( const TimePoint& t, double d )
1237 {
1238  return TimePoint( t.JDI(), t.JDF()+d );
1239 }
1240 
1247 inline TimePoint operator +( double d, const TimePoint& t )
1248 {
1249  return t + d;
1250 }
1251 
1258 inline TimePoint operator -( const TimePoint& t, double d )
1259 {
1260  return TimePoint( t.JDI(), t.JDF()-d );
1261 }
1262 
1263 // ----------------------------------------------------------------------------
1264 
1265 } // pcl
1266 
1267 #endif // __PCL_TimePoint_h
1268 
1269 // ----------------------------------------------------------------------------
1270 // EOF pcl/TimePoint.h - Released 2024-01-13T15:47:58Z
pcl::TimePoint::FromString
static TimePoint FromString(double &tz, const IsoString &dateTime)
Definition: TimePoint.h:919
pcl
PCL root namespace.
Definition: AbstractImage.h:76
pcl::FileTime
File date and time.
Definition: FileInfo.h:171
pcl::TimePoint::B1950
static TimePoint B1950()
Definition: TimePoint.h:884
pcl::TimePoint::TryFromString
static bool TryFromString(TimePoint &t, double &tz, const String &dateTime)
Definition: TimePoint.h:1032
pcl::CalendarTimeToJD
void PCL_FUNC CalendarTimeToJD(int &jdi, double &jdf, int year, int month, int day, double dayf=0) noexcept
pcl::String::TryParseISO8601DateTime
bool TryParseISO8601DateTime(int &year, int &month, int &day, double &dayf, double &tz) const noexcept
pcl::TimePoint::FromString
static TimePoint FromString(const String &dateTime)
Definition: TimePoint.h:979
pcl::TimePoint::TimePoint
TimePoint(const String &dateTime)
Definition: TimePoint.h:191
pcl::TimePoint::Month
int Month() const
Definition: TimePoint.h:321
pcl::Frac
constexpr T Frac(T x) noexcept
Definition: Math.h:640
pcl::TimePoint::Day
int Day() const
Definition: TimePoint.h:331
pcl::TimePoint::SecondsSinceReferenceEpoch
constexpr double SecondsSinceReferenceEpoch() const
Definition: TimePoint.h:728
pcl::TimePoint::TimePoint
TimePoint(double jd1, double jd2)
Definition: TimePoint.h:133
pcl::String
Unicode (UTF-16) string.
Definition: String.h:8112
pcl::TimePoint::DaysSince
constexpr double DaysSince(const TimePoint &t) const
Definition: TimePoint.h:663
pcl::TimePoint::DaysSinceUNIXEpoch
constexpr double DaysSinceUNIXEpoch() const
Definition: TimePoint.h:773
pcl::TimePoint::J2000
static TimePoint J2000()
Definition: TimePoint.h:860
pcl::JDToCalendarTime
void PCL_FUNC JDToCalendarTime(int &year, int &month, int &day, double &dayf, int jdi, double jdf) noexcept
pcl::TimePoint::YearsSinceReferenceEpoch
constexpr double YearsSinceReferenceEpoch() const
Definition: TimePoint.h:709
pcl::operator==
bool operator==(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
Definition: Array.h:2090
pcl::TimePoint::DaysSinceReferenceEpoch
constexpr double DaysSinceReferenceEpoch() const
Definition: TimePoint.h:699
pcl::IsoString
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
Definition: String.h:5424
pcl::TimePoint::ToString
String ToString(const ISO8601ConversionOptions &options=ISO8601ConversionOptions(), double tz=0) const
Definition: TimePoint.h:362
pcl::uint32
unsigned int uint32
Definition: Defs.h:669
pcl::TimePoint::IsValid
constexpr bool IsValid() const
Definition: TimePoint.h:231
pcl::operator+
Complex< T1 > operator+(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Definition: Complex.h:464
pcl::TimePoint::CenturiesSinceUNIXEpoch
constexpr double CenturiesSinceUNIXEpoch() const
Definition: TimePoint.h:791
pcl::ISO8601ConversionOptions
Formatting options for string representations of dates and times in ISO 8601 format.
Definition: String.h:398
Math.h
pcl::TimePoint::JD
constexpr double JD() const
Definition: TimePoint.h:583
pcl::TimePoint::SecondsSince
constexpr double SecondsSince(const TimePoint &t) const
Definition: TimePoint.h:690
pcl::TimePoint::TryFromString
static bool TryFromString(TimePoint &t, double &tz, const IsoString &dateTime)
Definition: TimePoint.h:1002
pcl::uint64
unsigned long long uint64
Definition: Defs.h:685
pcl::TimePoint::YearsSinceJ2000
constexpr double YearsSinceJ2000() const
Definition: TimePoint.h:746
pcl::TimePoint::FromString
static TimePoint FromString(const IsoString &dateTime)
Definition: TimePoint.h:962
pcl::TimePoint
An instant in any timescale.
Definition: TimePoint.h:102
pcl::TimePoint::CenturiesSince
constexpr double CenturiesSince(const TimePoint &t) const
Definition: TimePoint.h:681
pcl::String::ParseISO8601DateTime
void ParseISO8601DateTime(int &year, int &month, int &day, double &dayf, double &tz) const
pcl::TimePoint::GetCalendarTime
void GetCalendarTime(int &year, int &month, int &day, double &dayf) const
Definition: TimePoint.h:270
pcl::TimePoint::ToIsoString
IsoString ToIsoString(unsigned timeItems, unsigned precision=3, double tz=0, bool timeZone=true, bool zuluTime=true) const
Definition: TimePoint.h:443
pcl::IsoString::TryParseISO8601DateTime
bool TryParseISO8601DateTime(int &year, int &month, int &day, double &dayf, double &tz) const noexcept
pcl::operator-
Complex< T1 > operator-(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Definition: Complex.h:504
pcl::TimePoint::J2100
static TimePoint J2100()
Definition: TimePoint.h:872
pcl::TimePoint::YearsSince
constexpr double YearsSince(const TimePoint &t) const
Definition: TimePoint.h:672
pcl::TimePoint::Year
int Year() const
Definition: TimePoint.h:311
pcl::TimePoint::JDI
constexpr int JDI() const
Definition: TimePoint.h:557
pcl::TimePoint::LocalTimeToUTC
TimePoint LocalTimeToUTC() const
Definition: TimePoint.h:835
pcl::TimePoint::YearsSinceUNIXEpoch
constexpr double YearsSinceUNIXEpoch() const
Definition: TimePoint.h:782
pcl::TimePoint::MillisecondsSinceUNIXEpoch
constexpr double MillisecondsSinceUNIXEpoch() const
Definition: TimePoint.h:809
pcl::TimePoint::SecondsSinceUNIXEpoch
constexpr double SecondsSinceUNIXEpoch() const
Definition: TimePoint.h:800
pcl::TimePoint::ToIsoString
IsoString ToIsoString(const ISO8601ConversionOptions &options=ISO8601ConversionOptions(), double tz=0) const
Definition: TimePoint.h:412
pcl::TimePoint::TimePoint
TimePoint(const IsoString &dateTime)
Definition: TimePoint.h:174
pcl::TimePoint::MJD
constexpr double MJD() const
Definition: TimePoint.h:594
pcl::TimePoint::UTCToLocalTime
TimePoint UTCToLocalTime() const
Definition: TimePoint.h:826
pcl::TimePoint::TryFromString
static bool TryFromString(TimePoint &t, const String &dateTime)
Definition: TimePoint.h:1084
pcl::TimePoint::TryFromString
static bool TryFromString(TimePoint &t, const IsoString &dateTime)
Definition: TimePoint.h:1061
pcl::TimePoint::TimePoint
TimePoint(int year, int month, int day, int hour, int minute, double seconds)
Definition: TimePoint.h:160
pcl::TimePoint::JDF
constexpr double JDF() const
Definition: TimePoint.h:566
pcl::int32
signed int int32
Definition: Defs.h:663
pcl::TimePoint::CenturiesSinceJ2000
constexpr double CenturiesSinceJ2000() const
Definition: TimePoint.h:755
pcl::TimePoint::DayFraction
double DayFraction() const
Definition: TimePoint.h:341
String.h
pcl::TimePoint::TimePoint
TimePoint(int year, int month, int day, double dayFraction)
Definition: TimePoint.h:152
pcl::TimePoint::DaysSinceJ2000
constexpr double DaysSinceJ2000() const
Definition: TimePoint.h:737
pcl::TimePoint::CenturiesSinceReferenceEpoch
constexpr double CenturiesSinceReferenceEpoch() const
Definition: TimePoint.h:719
pcl::TimePoint::TimePoint
TimePoint(double jd)
Definition: TimePoint.h:116
pcl::TruncInt
int TruncInt(T x) noexcept
Definition: Math.h:1132
pcl::TimePoint::ReferenceEpoch
static TimePoint ReferenceEpoch()
Definition: TimePoint.h:851
pcl::TimePoint::ToString
String ToString(unsigned timeItems, unsigned precision=3, double tz=0, bool timeZone=true, bool zuluTime=true) const
Definition: TimePoint.h:393
pcl::IsoString::ParseISO8601DateTime
void ParseISO8601DateTime(int &year, int &month, int &day, double &dayf, double &tz) const
int32_max
#define int32_max
Definition: Defs.h:869
Defs.h
pcl::TimePoint::UNIXEpoch
static TimePoint UNIXEpoch()
Definition: TimePoint.h:896
pcl::TimePoint::GetCalendarTime
void GetCalendarTime(int &year, int &month, int &day) const
Definition: TimePoint.h:248
pcl::TimePoint::TimePoint
TimePoint(int year, int month, double days)
Definition: TimePoint.h:143
pcl::TimePoint::SecondsSinceJ2000
constexpr double SecondsSinceJ2000() const
Definition: TimePoint.h:764
pcl::TimePoint::GetCalendarTime
void GetCalendarTime(int &year, int &month, int &day, int &hour, int &minute, double &seconds) const
Definition: TimePoint.h:297
pcl::TimePoint::FromString
static TimePoint FromString(double &tz, const String &dateTime)
Definition: TimePoint.h:942
pcl::operator<
bool operator<(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
Definition: Array.h:2101