WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
WXP::DateVal Struct Reference

This struct defines basic date values. More...

#include "../include/DateVal.h"

Inheritance diagram for WXP::DateVal:
WXP::Date

Public Member Functions

int init ()
 
 DateVal ()
 
int validate ()
 
long computeSecs ()
 
int set (int ryear, int rmonth, int rday, int rhour, int rmin, float rsec)
 
int setYear (int val)
 
int getYear ()
 
int setMonth (int val)
 
int getMonth ()
 
int setDay (int val)
 
int getDay ()
 
int setHour (int val)
 
int getHour ()
 
int setMinute (int val)
 
int getMinute ()
 
int setSecond (float val)
 
float getSecond ()
 
int print ()
 

Public Attributes

int year
 
int month
 
int day
 
int hour
 
int min
 
float sec
 

Static Public Attributes

static int num_day [13] = { 0,31,59,90,120,151,181,212,243,273,304,334,365 }
 
static int num_day_leap [13] = { 0,31,60,91,121,152,182,213,244,274,305,335,366 }
 

Detailed Description

This struct defines basic date values.

Author
Dan Vietor

Constructor & Destructor Documentation

◆ DateVal()

DateVal::DateVal ( )

Constructor. Initializes values

References init().

Member Function Documentation

◆ computeSecs()

long DateVal::computeSecs ( )

Computes total seconds since 1/1/1970

References day, hour, min, WXP::Const::MISS, month, sec, validate(), and year.

Referenced by WXP::GribFile::readPDS().

◆ getDay()

int WXP::DateVal::getDay ( )
inline

Gets the day

References day.

◆ getHour()

int WXP::DateVal::getHour ( )
inline

Gets the hour

References hour.

◆ getMinute()

int WXP::DateVal::getMinute ( )
inline

Gets the minute

References min.

◆ getMonth()

int WXP::DateVal::getMonth ( )
inline

Gets the month

References month.

◆ getSecond()

float WXP::DateVal::getSecond ( )
inline

Gets the second

References sec.

◆ getYear()

int WXP::DateVal::getYear ( )
inline

Gets the year

References year.

◆ init()

int DateVal::init ( )

Initializes values

References day, hour, min, WXP::Const::MISS, month, sec, and year.

Referenced by DateVal(), WXP::RcmFile::decode(), WXP::NameConv::encode(), and WXP::Date::init().

◆ print()

int DateVal::print ( )

Prints date values to stdout.

References day, hour, min, WXP::Const::MISS, month, sec, and year.

◆ set()

int DateVal::set ( int  ryear,
int  rmonth,
int  rday,
int  rhour,
int  rmin,
float  rsec 
)

Sets all values

Parameters
ryearThe year (yyyy or 1900+yyy)
rmonthThe month (1-12)
rdayThe day (1-31)
rhourThe hour (0-23)
rminThe minute (0-59)
rsecThe second (0-59.99999)

References day, hour, min, month, sec, and year.

Referenced by WXP::NameConv::setLatest().

◆ setDay()

int WXP::DateVal::setDay ( int  val)
inline

Sets the day

References day.

◆ setHour()

int WXP::DateVal::setHour ( int  val)
inline

Sets the hour

References hour.

◆ setMinute()

int WXP::DateVal::setMinute ( int  val)
inline

Sets the minute

References min.

◆ setMonth()

int WXP::DateVal::setMonth ( int  val)
inline

Sets the month

References month.

◆ setSecond()

int WXP::DateVal::setSecond ( float  val)
inline

Sets the second

References sec.

◆ setYear()

int WXP::DateVal::setYear ( int  val)
inline

Sets the year

References year.

◆ validate()

int DateVal::validate ( )

Validates all values. Checks for out of range and resets to base value if invalid.

References day, hour, min, WXP::Const::MISS, month, sec, and year.

Referenced by WXP::Date::adjustHour(), WXP::Date::adjustHour(), WXP::Date::adjustHour(), computeSecs(), WXP::Date::set(), WXP::Date::set(), WXP::Date::set(), WXP::Date::set(), and WXP::Date::setTime().

Member Data Documentation

◆ day

int WXP::DateVal::day

◆ hour

int WXP::DateVal::hour

◆ min

int WXP::DateVal::min

◆ month

int WXP::DateVal::month

◆ num_day

int DateVal::num_day = { 0,31,59,90,120,151,181,212,243,273,304,334,365 }
static

Number of days in each month (nonleap)

Referenced by WXP::Date::getDays(), WXP::Date::getJulian(), WXP::Date::setDays(), and WXP::Date::setJulian().

◆ num_day_leap

int DateVal::num_day_leap = { 0,31,60,91,121,152,182,213,244,274,305,335,366 }
static

Number of days in each month (leap)

Referenced by WXP::Date::getJulian(), WXP::Date::setDays(), and WXP::Date::setJulian().

◆ sec

float WXP::DateVal::sec

◆ year

int WXP::DateVal::year

The documentation for this struct was generated from the following files: