00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef OFDATIME_H
00031 #define OFDATIME_H
00032
00033 #include "dcmtk/config/osconfig.h"
00034
00035 #include "dcmtk/ofstd/ofstring.h"
00036 #include "dcmtk/ofstd/ofdate.h"
00037 #include "dcmtk/ofstd/oftime.h"
00038
00039
00040
00041
00042
00043
00046 class OFDateTime
00047 {
00048
00049 public:
00050
00054 OFDateTime();
00055
00059 OFDateTime(const OFDateTime &dateTime);
00060
00065 OFDateTime(const OFDate &dateVal,
00066 const OFTime &timeVal);
00067
00077 OFDateTime(const unsigned int year,
00078 const unsigned int month,
00079 const unsigned int day,
00080 const unsigned int hour,
00081 const unsigned int minute,
00082 const double second,
00083 const double timeZone = 0);
00084
00087 virtual ~OFDateTime();
00088
00093 virtual OFDateTime &operator=(const OFDateTime &dateTime);
00094
00102 virtual OFBool operator==(const OFDateTime &dateTime) const;
00103
00111 virtual OFBool operator!=(const OFDateTime &dateTime) const;
00112
00116 virtual void clear();
00117
00122 virtual OFBool isValid() const;
00123
00135 OFBool setDateTime(const unsigned int year,
00136 const unsigned int month,
00137 const unsigned int day,
00138 const unsigned int hour,
00139 const unsigned int minute,
00140 const double second,
00141 const double timeZone = 0);
00142
00148 OFBool setDate(const OFDate &dateVal);
00149
00155 OFBool setTime(const OFTime &timeVal);
00156
00163 OFBool setDateTime(const OFDate &dateVal,
00164 const OFTime &timeVal);
00165
00171 OFBool setCurrentDateTime();
00172
00181 OFBool setISOFormattedDateTime(const OFString &formattedDateTime);
00182
00186 const OFDate &getDate() const;
00187
00191 const OFTime &getTime() const;
00192
00208 OFBool getISOFormattedDateTime(OFString &formattedDateTime,
00209 const OFBool showSeconds = OFTrue,
00210 const OFBool showFraction = OFFalse,
00211 const OFBool showTimeZone = OFFalse,
00212 const OFBool showDelimiter = OFTrue) const;
00213
00230 OFBool getISOFormattedDateTime(OFString &formattedDateTime,
00231 const OFBool showSeconds ,
00232 const OFBool showFraction ,
00233 const OFBool showTimeZone ,
00234 const OFBool showDelimiter ,
00235 const OFString &dateTimeSeparator ) const;
00236
00237
00238
00242 static OFDateTime getCurrentDateTime();
00243
00244
00245 private:
00246
00248 OFDate Date;
00249
00251 OFTime Time;
00252 };
00253
00254
00261 STD_NAMESPACE ostream& operator<<(STD_NAMESPACE ostream& stream, const OFDateTime &dateTime);
00262
00263
00264 #endif
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306