Quaero.DW.Date
Quaero.DW.Date Class
public class Quaero.DW.Date : Quaero.DW.Json;
This class encapsulates a YYYY-MM-DD date. The date might be a
partial one; MM and DD might be missing. It is used by
JSON criteria
to constrain a search to a given time period.
Constructor
new Quaero.DW.Date(System.String date);
Create a DW.Date object from a string.
Parameters
- date
-
The date you want. May be "YYYY" or
"YYYY-MM" or "YYYY-MM-DD" where YYYY is a year, MM is the month (01 to 12) and DD is
the day (01 to 31). The date is not check for validity, so you may pass
"2019-17-44." But you don't want to.
[System.String]
ToString() Method
Quaero.DW.Date.ToString();
Convert the Date object to it's string form.
Implicit Conversion From System.String
implicit public static operator Quaero.DW.Date (System.String str);
Implicit conversion from a string to a Date.
Parameters
- str
-
String representation of the date.
[System.String]
Returns
Example
using Quaero;
DW.Criteria crit = new DW.Criteria ();
crit.during = "2019-04";
// Same as new Date ( 2019, 4 );
Implicit Conversion To System.String
implicit public static operator System.String (Quaero.DW.Date date);
Implicit conversion from a Date to a string.
Parameters
- date
-
[Quaero.DW.Date]
Returns
Example
using Quaero;
DW.Search search = new DW.Search ();
search.crit.during = new Date( 2019, 3, 14 );
Console.WriteLine( search.crit.during );
// Outputs 2019-03-14