Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Just tried the built in query builder to list some pages where the publish date is greater than some date, and it fails out of the box... Whats the right syntax?
The value you compare the CreateDate with doesn't seem to be in correct format as 3/6/2019 12:00:00 AM or "3/6/2019 12:00:00 AM".
CreateDate
3/6/2019 12:00:00 AM
"3/6/2019 12:00:00 AM"
You need to convert/parse this to a DateTimeobject, e.g.
DateTime
.Where(x.CreateDate >= new DateTime(2019, 3, 6, 12, 0, 0));
or
.Where(x.CreateDate >= DateTime.Parse("yyyy-MM-dd HH:mm:ss"));
where yyyy-MM-dd HH:mm:ss is your date time format.
yyyy-MM-dd HH:mm:ss
I ended up with
var now = DateTime.Now; var eventtimeclean = item.Value<DateTime>("eventdato"); if (eventtimeclean > now) { (my stuff) }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Error in query builder when using dates
Just tried the built in query builder to list some pages where the publish date is greater than some date, and it fails out of the box... Whats the right syntax?
The value you compare the
CreateDate
with doesn't seem to be in correct format as3/6/2019 12:00:00 AM
or"3/6/2019 12:00:00 AM"
.You need to convert/parse this to a
DateTime
object, e.g.or
where
yyyy-MM-dd HH:mm:ss
is your date time format.I ended up with
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.