Skip to content
Permalink
Browse files

Add expression functions for handling date/time:

    - year,month,day,hour,minute,second extraction
    - new QgsInterval objects - handles time amounts
    - age() function returns the difference between two  datetimes
    - $now returns the current date and time
    - support for datetime - interval = new datetime
    - tointerval, todate, totime functions
    - tests ;)
  • Loading branch information
NathanW2 committed Jun 30, 2012
1 parent 4b81e36 commit c467e79f3cde7bb079912bf88e1d03059813f897
@@ -1,4 +1,3 @@

class QgsExpression
{
%TypeHeaderCode
@@ -304,7 +303,24 @@ public:
virtual void visit( QgsExpression::NodeCondition* n ) = 0;
};

class Interval
{
public:
Interval(int seconds);
~Interval();
int years();
int weeks();
int days();
int hours();
int minutes();
int seconds();
bool isValid();
void setValid(bool valid);
bool operator==(const QgsExpression::Interval& other) const;
static QgsExpression::Interval invalidInterVal();
static QgsExpression::Interval fromString(QString string);
};

/** entry function for the visitor pattern */
void acceptVisitor( QgsExpression::Visitor& v );

};

0 comments on commit c467e79

Please sign in to comment.
You can’t perform that action at this time.