In Umbraco CMS I have created a 6 events. In that 3 were created in January and the other 3 were created in February.
I want to fetch the events created in current month. For that I have used query builder in Umbraco and the query was:
@{
var selection = Umbraco.Content(Guid.Parse("9359beaa-b580-4f2c-8c8f-239f29e560b4"))
.ChildrenOfType("aseanEventsItem")
.Where(x => (x.CreateDate >= DateTime.Now.Date))
.Where(x => x.IsVisible());
}
<ul>
@foreach (var item in selection)
{
<li>
<a href="@item.Url">@item.Name</a>
</li>
}
</ul>
It's working fine now. How I can get the current month?