barista 0 Posted May 11, 2010 Report Share Posted May 11, 2010 Hi $date provides a string in this format - 05/11/2010 17:40:22, i.e. dd/mm/yyyy hh:mm:ss Is it possible to manipulate that string within Ubot? For example the UK date format is mm/dd/yyyy. I'd also like to chop-off the time part of the string. Cheers. Quote Link to post Share on other sites
Net66 54 Posted May 11, 2010 Report Share Posted May 11, 2010 Hi $date provides a string in this format - 05/11/2010 17:40:22, i.e. dd/mm/yyyy hh:mm:ss Is it possible to manipulate that string within Ubot? For example the UK date format is mm/dd/yyyy. I'd also like to chop-off the time part of the string. Cheers.Yes you have to use some javascript. Here is an example from a bot of mine; This takes in a date in ubots format (which I have already assigned to variable #dte) and then puts it out in a format of my choice. In this example it is mm/dd/yyyy, you can change the last line of the javascript about to mash it up however you like. Andy Quote Link to post Share on other sites
barista 0 Posted May 11, 2010 Author Report Share Posted May 11, 2010 It's been years since I did any javascript and to have to do so with this tool is a bit of a disappointment, given that it is promoted as a marketing tool for non-programmers. However, with a heave and a sigh I will roll-up my sleeves and have a go because it appears that JS is the only solution to a couple of other problems. Hopefully the Ubot development team will protect us from this sort of 'under the hood' tinkering in the future? Thanks for your help Net66. Quote Link to post Share on other sites
theskinnys 1 Posted May 11, 2010 Report Share Posted May 11, 2010 It's been years since I did any javascript and to have to do so with this tool is a bit of a disappointment, given that it is promoted as a marketing tool for non-programmers. However, with a heave and a sigh I will roll-up my sleeves and have a go because it appears that JS is the only solution to a couple of other problems. Hopefully the Ubot development team will protect us from this sort of 'under the hood' tinkering in the future? Thanks for your help Net66. ubot is already getting bloated as it is. Adding every small feature will only add to that. Quote Link to post Share on other sites
Net66 54 Posted May 11, 2010 Report Share Posted May 11, 2010 It's been years since I did any javascript and to have to do so with this tool is a bit of a disappointment, given that it is promoted as a marketing tool for non-programmers. However, with a heave and a sigh I will roll-up my sleeves and have a go because it appears that JS is the only solution to a couple of other problems. Hopefully the Ubot development team will protect us from this sort of 'under the hood' tinkering in the future? Thanks for your help Net66.There is a non-java script way of doing this using the string libraries in the scripting section but you end up with an overly long sub to handle what can be done quickly and efficiently with a short snippet of javascript. Andy Quote Link to post Share on other sites
barista 0 Posted May 12, 2010 Author Report Share Posted May 12, 2010 ubot is already getting bloated as it is. Adding every small feature will only add to that. Hi theskinny, how would you describe your programming skill set? Quote Link to post Share on other sites
alcr 135 Posted May 12, 2010 Report Share Posted May 12, 2010 It's been years since I did any javascript and to have to do so with this tool is a bit of a disappointment, given that it is promoted as a marketing tool for non-programmers. However, with a heave and a sigh I will roll-up my sleeves and have a go because it appears that JS is the only solution to a couple of other problems. Hopefully the Ubot development team will protect us from this sort of 'under the hood' tinkering in the future? Thanks for your help Net66.We can not program a tool that will cover EVERYTHING for EVERYONE But yes, the date function could be adjusted a bit more. Quote Link to post Share on other sites
theskinnys 1 Posted May 13, 2010 Report Share Posted May 13, 2010 Hi theskinny, how would you describe your programming skill set? a year of qbasic back in high school so I guess I have an unfair advantage though I'm sure that year is equivalent to like two weeks of a college course. Also whatever javascript and php I've had to manually learn for ubot/seo. Quote Link to post Share on other sites
barista 0 Posted May 14, 2010 Author Report Share Posted May 14, 2010 We can not program a tool that will cover EVERYTHING for EVERYONE But yes, the date function could be adjusted a bit more. I totally take your point and it's your call to decide where to draw the line. 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.