Qwt User's Guide  6.1.6
qwt_date.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2  * Qwt Widget Library
3  * Copyright (C) 1997 Josef Wilgen
4  * Copyright (C) 2002 Uwe Rathmann
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the Qwt License, Version 1.0
8  *****************************************************************************/
9 
10 #ifndef _QWT_DATE_H_
11 #define _QWT_DATE_H_
12 
13 #include "qwt_global.h"
14 #include <qdatetime.h>
15 
42 class QWT_EXPORT QwtDate
43 {
44 public:
49  enum Week0Type
50  {
59 
66  FirstDay
67  };
68 
76  {
79 
82 
85 
88 
90  Day,
91 
94 
97 
99  Year
100  };
101 
102  enum
103  {
105  JulianDayForEpoch = 2440588
106  };
107 
108  static QDate minDate();
109  static QDate maxDate();
110 
111  static QDateTime toDateTime( double value,
112  Qt::TimeSpec = Qt::UTC );
113 
114  static double toDouble( const QDateTime & );
115 
116  static QDateTime ceil( const QDateTime &, IntervalType );
117  static QDateTime floor( const QDateTime &, IntervalType );
118 
119  static QDate dateOfWeek0( int year, Week0Type );
120  static int weekNumber( const QDate &, Week0Type );
121 
122  static int utcOffset( const QDateTime & );
123 
124  static QString toString( const QDateTime &,
125  const QString & format, Week0Type );
126 };
127 
128 #endif
QwtDate::Minute
@ Minute
The interval is related to minutes.
Definition: qwt_date.h:84
QwtDate::Week
@ Week
The interval is related to weeks.
Definition: qwt_date.h:93
QwtDate::IntervalType
IntervalType
Definition: qwt_date.h:76
QwtDate
A collection of methods around date/time values.
Definition: qwt_date.h:43
QwtDate::Month
@ Month
The interval is related to months.
Definition: qwt_date.h:96
QwtDate::Day
@ Day
The interval is related to days.
Definition: qwt_date.h:90
QwtDate::FirstThursday
@ FirstThursday
Definition: qwt_date.h:58
QwtDate::Week0Type
Week0Type
Definition: qwt_date.h:50
QwtDate::Second
@ Second
The interval is related to seconds.
Definition: qwt_date.h:81
QwtDate::Hour
@ Hour
The interval is related to hours.
Definition: qwt_date.h:87
QwtDate::Millisecond
@ Millisecond
The interval is related to milliseconds.
Definition: qwt_date.h:78