WXP C++ Library Version 6.74.9
|
This class manipulates dates. More...
#include "../include/DateTool.h"
Static Public Member Functions | |
static int | getSeconds (const char *str) |
static int | getMinutes (const char *str) |
static int | getCurrent (String &str) |
static int | getCurrent (const char *encode, String &str) |
static int | decode (const char *str, Date &date) |
static int | decodeMonth (const char *str) |
static const char * | getMonthLower (int month) |
static const char * | getMonth (int month) |
static const char * | getMonthLong (int month) |
static const char * | getDayWeek (int day) |
static int | createLabel (const char *prefix, Date &date, Timezone &tz, int flag, String &str) |
static int | createLabel (const char *prefix, Date &date, Timezone &tz, String &str) |
static int | createLabel (Date &date, Timezone &tz, String &str) |
static int | createLabel (Date &date, String &str) |
static int | createLabel (Date &date, Timezone &tz, float hour, String &str) |
static int | createLabel (Date &date, Timezone &tz, const char *name, ForeTime &ftime, String &str) |
static int | createLabel (Date &date, Timezone &tz, const char *name, float hour, String &str) |
static int | createLabel (Date &date, const char *name, float hour, String &str) |
static int | createHourLabel (float hour, int flag, String &str) |
static int | print (int secs) |
Static Public Attributes | |
static const int | NONE = 0x0 |
static const int | DAY_OF_WEEK = 0x1 |
This class manipulates dates.
|
static |
Creates a hour string converting hours to days if needed. Multiples of 12 go to x.5 days and multiples of 24 go to x days. Values <= 60 are left as hours unless flag set.
hour | Hour value to convert |
flag | 1=use day values for hours < 60 |
str | Output string |
References WXP::String::clear(), WXP::String::copy(), WXP::Const::MISS, and WXP::String::printf().
Referenced by createLabel().
|
static |
Creates a string label for a date
prefix | A string prefix to add to label |
date | The date class to use |
tz | The output timezone to use |
flag | A flag to alter encoding of label (NONE, DAY_OF_WEEK) |
str | Output string |
References WXP::String::append(), WXP::String::aprintf(), WXP::Date::changeTimezone(), WXP::String::clear(), DAY_OF_WEEK, WXP::Date::getDay(), WXP::Date::getDayOfWeek(), WXP::Date::getHour(), WXP::Date::getMinute(), WXP::Date::getMonth(), getMonth(), WXP::Timezone::getName(), WXP::Timezone::getOffset(), WXP::Timezone::getPM(), WXP::Date::getSecond(), WXP::Date::getYear00(), WXP::Date::isSet(), WXP::Timezone::isSet(), WXP::Const::MISS, WXP::String::set(), and WXP::StrLib::valid().
Referenced by WXP::NidsImage::addSite(), createLabel(), createLabel(), createLabel(), createLabel(), createLabel(), createLabel(), createLabel(), WXP::FrontPlot::draw(), WXP::HurPlot::draw(), WXP::Lev2Plot::draw(), WXP::LightPlot::draw(), WXP::MdrPlot::draw(), WXP::MeteoPlot::draw(), WXP::RawPlot::draw(), WXP::RcmPlot::draw(), WXP::RedbookPlot::draw(), WXP::WarnPlot::draw(), WXP::WatchPlot::draw(), WXP::SfcCdfFile::open(), WXP::SfcWxpFile::open(), WXP::SfcXmlFile::open(), WXP::MdrData::print(), WXP::MosData::print(), WXP::MosUData::print(), WXP::RcmData::print(), WXP::MosData::printTable(), WXP::KavradFile::read(), WXP::NowradFile::read(), WXP::MdrImage::readFile(), WXP::GiniFile::readHeader(), WXP::SatCdfFile::readHeader(), WXP::SatUniFile::readHeader(), WXP::AreaFile::readHeader(), WXP::LritFile::readHeader(), and WXP::NidsImage::setImage().
Creates a string label for a date
prefix | A string prefix to add to label |
date | The date class to use |
tz | The output timezone to use |
str | Output string |
References createLabel().
Creates a label string from a date, forecast time and source label
date | The date class to use |
name | The source of data label (such as model name) |
hour | The forecast time in hours |
str | Output string |
References createLabel().
Creates a label string from a date
date | The date class to use |
str | Output string |
References createLabel().
|
static |
Creates a label string from a date, forecast time and source label
date | The date class to use |
tz | The timezone to offset the date |
name | The source of data label (such as model name) |
hour | The forecast time in hours |
str | Output string |
References WXP::Date::addSeconds(), WXP::String::append(), createHourLabel(), createLabel(), DAY_OF_WEEK, WXP::String::length(), WXP::Const::MISS, WXP::String::set(), and WXP::StrLib::valid().
|
static |
Creates a label string from a date, forecast time and source label
date | The date class to use |
tz | The timezone to offset the date |
name | The source of data label (such as model name) |
ftime | The forecast time |
str | Output string |
References WXP::Date::addHours(), WXP::String::append(), createLabel(), WXP::ForeTime::getFore(), WXP::String::set(), and WXP::ForeTime::toTimeLabel().
Creates a label string from a date adding an hour offset
date | The date class to use |
tz | The output timezone to use |
hour | Number of hours to offset date |
str | Output string |
References WXP::Date::addSeconds(), createLabel(), and WXP::Const::MISS.
Creates a string label for a date
date | The date class to use |
tz | The output timezone to use |
str | Output string |
References createLabel().
|
static |
Attempts to decode a string which contains a date and output a Date class
str | String to decode |
date | Date class to put result |
References WXP::DateVal::day, decodeMonth(), WXP::DateVal::hour, WXP::Date::init(), WXP::DateVal::min, WXP::Const::MISS, WXP::DateVal::month, WXP::DateVal::sec, WXP::Date::set(), and WXP::DateVal::year.
Referenced by WXP::SfcCdfFile::open(), WXP::SfcUniFile::open(), WXP::SfcWxpFile::open(), WXP::SfcXmlFile::open(), WXP::GifFile::read(), WXP::LZWComp::read(), WXP::PngFile::read(), WXP::SfcCdfFile::read(), and WXP::ImgWxpFile::readHeader().
|
static |
Retrieves a integral month from string
str | String to decode |
Referenced by WXP::NameConv::decode(), decode(), and WXP::MosUFile::read().
|
static |
Returns a string with the current date given a format
encode | Format to use |
str | Output string |
References WXP::StrLib::equal(), WXP::Date::set(), and WXP::Date::toText().
|
static |
Returns a string with the current date
str | String with current date "yyyy mmm dd hh:mm:ssZ" |
References WXP::Date::set(), and WXP::Date::toText().
Referenced by WXP::Message::print(), and WXP::PngFile::write().
|
static |
|
static |
Computes number of minutes from string
str | The string to convert (hhnn) |
Referenced by WXP::LightPlot::setFile().
|
static |
Returns a string for the month
month | The month (1-12) |
Referenced by createLabel(), and WXP::NameConv::encode().
|
static |
Returns a long string for the month (mixed case)
month | The month (1-12) |
|
static |
Returns a string for the month (lower case)
month | The month (1-12) |
Referenced by WXP::NameConv::encode(), and WXP::WmoIngest::setAction().
|
static |
Computes number of seconds from string
str | The string to convert (yyyymmddhhnn) |
References WXP::DateVal::day, WXP::Date::getSeconds(), WXP::DateVal::hour, WXP::DateVal::min, WXP::DateVal::month, WXP::Date::set(), and WXP::DateVal::year.
Referenced by WXP::Prog::readResrcFile().
|
static |
Prints a string given time in seconds since 1/1/1970 (debug tool)
secs | Number of seconds |
References WXP::Date::print().
|
static |
Flag to add day of week to label
Referenced by createLabel(), and createLabel().
|
static |
Null Flag