Hi
I have below code . If i want to view current date videos then what should be the code
C#
var today = DateTime.Now.Date;
var sevenDaysAgo = today.AddDays(-1).ToString("yyyy-MM-ddTHH:mm:ssZ");
request.AddParameter("publishedAfter", sevenDaysAgo);Thanks

Naimish MakwanaRank #324 · 7.7K reputationPosted Feb 22, 2023, 8:12 AM EST
Hello Ramco,
Try with remove that parameter if it is work then fine :)
else use both. :)
Thanks
Naimish Makwana
Ramco RamcoRank #462 · 5.4K reputationPosted Feb 22, 2023, 7:30 AM EST
Hi Naimish
Do we need to write this parameter also -
request.AddParameter("publishedBefore", currentDate);
Thanks
Naimish MakwanaRank #324 · 7.7K reputationPosted Feb 22, 2023, 6:50 AM EST
Hello Ramco,
Use below code:
// Set the publishedAfter and publishedBefore parameters to the current date var currentDate = DateTime.UtcNow.Date.ToString("yyyy-MM-ddT00:00:00Z"); request.AddParameter("publishedAfter", currentDate); request.AddParameter("publishedBefore", currentDate);Thanks
Naimish Makwana