turbolapp 5 Posted December 21, 2009 Report Share Posted December 21, 2009 I thought I could use the date constant and just set a variable that if today's date is greater than whatever date I could command the bot to pause...but it's not working. Is this even possible? and if so what am I doing wrong? (attaching bot)date.ubot Quote Link to post Share on other sites
Guest Jim Posted December 21, 2009 Report Share Posted December 21, 2009 I thought I could use the date constant and just set a variable that if today's date is greater than whatever date I could command the bot to pause...but it's not working. Is this even possible? and if so what am I doing wrong? (attaching bot)The problem with what you're trying to is that ubot currently treats the date as a string object, so when you're comparing the dates, you're just comparing strings. You could use this to compare equality, but you won't be able to see if its less or greater than. Luckily, javascript's Date() object supports comparison Here's a snippet that should work: Quote Link to post Share on other sites
turbolapp 5 Posted December 21, 2009 Author Report Share Posted December 21, 2009 The problem with what you're trying to is that ubot currently treats the date as a string object, so when you're comparing the dates, you're just comparing strings. You could use this to compare equality, but you won't be able to see if its less or greater than. Luckily, javascript's Date() object supports comparison Here's a snippet that should work: Wow. I would have never come up with that. Thanks, I'll give that a try. edit: worked perfectly, of course! Thanks again Jim. Quote Link to post Share on other sites
UBotDev 276 Posted February 16, 2011 Report Share Posted February 16, 2011 Hey, I have date in format "DD.MM.YYYY" and I cant find the easy way to do this job. Can you please give me a tip? I also have problem inserting variable instead of "12/20/2009". I need to check if scraped date already past or not... Thanks for helping. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.