Jump to content
UBot Underground

Recommended Posts

Got it.

 

I now see all the options available for custom formatting. I didn't realise the drop-downs on that page were active. I though it was a screen shot!

 

Thanks, and sorry for being a dumb-ass :D

 

Great to hear you got it.

 

.cs files for visual studio created already.

 

Can you add these into your plugin for expanded functionality.   Adds 16 or 17 functions i think

http://www.botguru.net/time.zip

 

NOTE THIS IS NOT A PLUGIN.  This is for the OP to add to his plugin.

 

Thanks TJ for contribution; I will consider adding those features as part of next release, I just think I'll try to "aggregate" some of those. 

Link to post
Share on other sites
  • 5 months later...
  • 7 months later...

Hi folks,

I am trying to call the Date in a Variable for file name when saved but receive error when compiled.

I use the following code examples:

 

set(#datecreated,$plugin function("DateTime Manipulation.dll", "$datetime manipulation", $date, "UBOT", "Full date/time (short time)", "en-US", "en-US"),"Global")
save to file("{$special folder("Application")}\\{#somevarname}-{#datecreated}.csv",&tablename)

 

Second example:

set(#datecreated,$date,"Global")
save to file("{$special folder("Application")}\\{#somevarname}{#time}-1.csv",&tablename)

 

I am trying to have the file name save as

name-Time-Date.csv

 

Anyone can assist please?

Link to post
Share on other sites
  • 1 year later...

Hey Everyone,

 

I've got a new plugin for you, which will let you manipulate any kind of dates and/or times (even conversion from and to different culture/language).

 

Plugin will add a new function called "$datetime manipulation", and you'll find it under system functions.

 

 

For more information and download please visit http://ubotdev.com/free-plugin-datetime-manipualtion

 

 

Screenshot:

 

http://ubotdev.com/wp-content/uploads/2013/04/DATETIME-Manipulation.png

 

Examples of Usage - UBot Code Snippets:

 

Update v1.01:

Added a new function called "$datetime time span" that will convert an integer to time span string.

 

Hello, Where I can download this plugin? Thank you

Link to post
Share on other sites
  • 1 month later...

I'm trying to subtract 2 hours from time/date formatted like: 

 

Oct 9, 2017 12:00 AM 
Sep 20, 2017 7:25 AM
 
I can't get it to work correctly for times between midnight and 2am. 
 
 
I've worked it out thanks to some other helpful tips in the forum: 
 
 
 
 
set(#dateTime,"Oct 9, 2017 12:00 AM","Global")
set(#subtractHours,$subtractHours(),"Global")
alert(#subtractHours)
define $subtractHours {
    comment("Convert to Unix time so we can easily subtract a couple of hours (in seconds).")
    set(#unixTimeConversion,$plugin function("DateTime Manipulation.dll", "$datetime manipulation", #dateTime, "MMM d, yyyy hh:mm tt", "UNIX", "en-US", "en-US"),"Local")
    comment("Subtract 7200 seconds (2 hours) then return in desired format")
    return($plugin function("DateTime Manipulation.dll", "$datetime manipulation", $subtract(#unixTimeConversion,7200), "UNIX", "MMM d, yyyy hh:mm tt", "en-US", "en-US"))
}
Link to post
Share on other sites

 

I'm trying to subtract 2 hours from time/date formatted like: 

 

Oct 9, 2017 12:00 AM 
Sep 20, 2017 7:25 AM
 
I can't get it to work correctly for times between midnight and 2am. 
 
 
I've worked it out thanks to some other helpful tips in the forum: 
 
 
 
 
set(#dateTime,"Oct 9, 2017 12:00 AM","Global")
set(#subtractHours,$subtractHours(),"Global")
alert(#subtractHours)
define $subtractHours {
    comment("Convert to Unix time so we can easily subtract a couple of hours (in seconds).")
    set(#unixTimeConversion,$plugin function("DateTime Manipulation.dll", "$datetime manipulation", #dateTime, "MMM d, yyyy hh:mm tt", "UNIX", "en-US", "en-US"),"Local")
    comment("Subtract 7200 seconds (2 hours) then return in desired format")
    return($plugin function("DateTime Manipulation.dll", "$datetime manipulation", $subtract(#unixTimeConversion,7200), "UNIX", "MMM d, yyyy hh:mm tt", "en-US", "en-US"))
}

 

 

Whenever you work with time conversion always change it to unix time and subtract or add seconds which is what you did here, I'm just posting for reference for anybody else reading.

Link to post
Share on other sites
  • 1 year later...

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...