|
STIR 6.4.0
|

Files | |
| file | date_time_functions.cxx |
| Functions for date-time conversions. | |
| file | date_time_functions.h |
| Functions for date-time conversions. | |
| file | test_DateTime.cxx |
| A simple program to test the date-time conversions. | |
Classes | |
| struct | stir::DateTimeStrings |
A simple structure to hold 2 strings (date and time) More... | |
| class | stir::DateTimeTest |
| Class with tests for date time functions. More... | |
Functions | |
| int | stir::time_zone_offset_in_secs () |
| returns the current time_zone in seconds (without DST)The result is independent of DST. | |
| int | stir::current_time_zone_and_DST_offset_in_secs () |
| returns the current time_zone in seconds (taking DST into account) | |
| std::string | stir::DICOM_date_time_to_DT (const std::string &date, const std::string &time, const std::string &TZ="") |
| concatenate date, time and optional time_zone info. | |
| double | stir::DICOM_datetime_to_secs_since_Unix_epoch (const std::string &str, bool silent=false) |
| convert DICOM DT string to seconds since the Unix epoch (i.e. 1 Jan 1970 00:00:00 UTC) | |
| std::string | stir::secs_since_Unix_epoch_to_DICOM_datetime (double secs, int time_zone_offset_in_secs=current_time_zone_and_DST_offset_in_secs()) |
| convert epoch to DICOM DT string in specified time zone (+3600 is CET) | |
| DateTimeStrings | stir::DICOM_datetime_to_Interfile (const std::string &str) |
| Convert from DICOM DT to Interfile. | |
| std::string | stir::Interfile_datetime_to_DICOM (const DateTimeStrings &) |
| Convert from Interfile to DICOM DT. | |
| double | stir::Interfile_datetime_to_secs_since_Unix_epoch (const DateTimeStrings &, bool silent=false) |
| convert Interfile DateTime strings to seconds since the Unix epoch (i.e. 1 Jan 1970 00:00:00 UTC)Interfile uses a format year 1900:01:01, time 02:01:00.00. | |
| DateTimeStrings | stir::secs_since_Unix_epoch_to_Interfile_datetime (double secs, int time_zone_offset_in_secs=current_time_zone_and_DST_offset_in_secs()) |
| convert epoch to Interfile date-times string in specified time zone (+3600 is CET) | |
| int stir::current_time_zone_and_DST_offset_in_secs | ( | ) |
returns the current time_zone in seconds (taking DST into account)
References current_time_zone_and_DST_offset_in_secs(), and time_zone_offset_in_secs().
Referenced by current_time_zone_and_DST_offset_in_secs(), and stir::DateTimeTest::run_tests().
| std::string stir::DICOM_date_time_to_DT | ( | const std::string & | date, |
| const std::string & | time, | ||
| const std::string & | TZ = "" ) |
concatenate date, time and optional time_zone info.
Minimal checks on format are performed, calling error() if input is incorrect.
References DICOM_date_time_to_DT(), error(), and standardise_interfile_keyword().
Referenced by DICOM_date_time_to_DT(), and stir::DateTimeTest::run_tests().
| double stir::DICOM_datetime_to_secs_since_Unix_epoch | ( | const std::string & | str, |
| bool | silent = false ) |
convert DICOM DT string to seconds since the Unix epoch (i.e. 1 Jan 1970 00:00:00 UTC)
true, silence warnings about TZ info not being present Time_Zone info is given by "&ZZXX", with & = "+" or "-", and ZZ = Hours and XX = Minutes of offset w.r.t. UTC. If no TZ is given, the local time_zone with DST is used. A warning() is then issued, unless silent=true. References DICOM_datetime_to_secs_since_Unix_epoch(), error(), info(), standardise_interfile_keyword(), and time_zone_offset_in_secs().
Referenced by DICOM_datetime_to_Interfile(), DICOM_datetime_to_secs_since_Unix_epoch(), Interfile_datetime_to_secs_since_Unix_epoch(), and stir::DateTimeTest::run_tests().
| double stir::Interfile_datetime_to_secs_since_Unix_epoch | ( | const DateTimeStrings & | , |
| bool | silent = false ) |
convert Interfile DateTime strings to seconds since the Unix epoch (i.e. 1 Jan 1970 00:00:00 UTC)Interfile uses a format year 1900:01:01, time 02:01:00.00.
Uses DICOM conventions for specifying the time_zone, i.e. appending "&ZZXX", with & = "+" or "-", and ZZ = Hours and XX = Minutes of offset w.r.t. UTC.
References DICOM_datetime_to_secs_since_Unix_epoch(), Interfile_datetime_to_DICOM(), and Interfile_datetime_to_secs_since_Unix_epoch().
Referenced by Interfile_datetime_to_secs_since_Unix_epoch(), stir::InterfileHeader::post_processing(), and stir::DateTimeTest::run_tests().