TimeUtilities Namespace Reference

Convenience functions when using time-based objects. More...


Functions

unsigned int timeStructToSecondsFrom1940 (const struct tm &timeStruct)
struct tm secondsFrom1940ToTimeStruct (unsigned int seconds)
bool isLeapYear (int year)

Variables

const long TimeScaleOffset = 946771200


Detailed Description

Convenience functions when using time-based objects.

Function Documentation

bool TimeUtilities::isLeapYear ( int  year  ) 

Queries whether a given year is a leap year.

Parameters:
year The four-digit year to query if it is a leap year.
Returns:
Returns true if the given year is a leap year; otherwise returns false.

struct tm TimeUtilities::secondsFrom1940ToTimeStruct ( unsigned int  seconds  )  [read]

Converts seconds from 1940 to a time struct.

Parameters:
seconds The number of seconds after midnight 1 Jan 1940 from which to get a time struct. To convert a time_t (seconds from 1970) to this value, simply add TimeUtilities::TimeScaleOffset.
Returns:
The time struct based on the given seconds from 1940.

unsigned int TimeUtilities::timeStructToSecondsFrom1940 ( const struct tm &  timeStruct  ) 

Converts a time struct to seconds from 1940.

Parameters:
timeStruct The time struct from which to get seconds.
Returns:
Returns the number of seconds after midnight 1 Jan 1940. To convert this value to a time_t (seconds from 1970) object, simply subtract TimeUtilities::TimeScaleOffset.


Variable Documentation

const long TimeUtilities::TimeScaleOffset = 946771200

The number of seconds between midnight 1 Jan 1940 and midnight 1 Jan 1970.

Definition at line 23 of file TimeUtilities.h.


Software Development Kit - Opticks 4.8.0 Build 15482