Jump to content
UBot Underground

Recommended Posts

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.

Link to post
Share on other sites

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;

post-732-12735968109415_thumb.jpg

 

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

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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

Link to post
Share on other sites

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?

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...