Sign in to follow this  
Followers 0
cad29

Date Help

8 posts in this topic

Hi I need help in my date program i have a program that it will automatically add 2 days once he got a data from a web site but the problem is if the data is like this SEP 27,2006 it doesnt add automatically i do the

heres the program

movemouse(287,313,2,1)

send("^c")

$date = ClipPut()

$Newdate = _DateAdd ( $sType, 2, $sDate )

msgbox(0,"New Date",$Newdate)

this one works fine once the value he got from date is like this '2004/1/31' but once he got a value of alpha numeric SEP 27,2006 it doesnt add anymore

Any help please thank you so much

Share this post


Link to post
Share on other sites



correction it is _DateAdd ( 'd', 2, $sDate )

Share this post


Link to post
Share on other sites

thanks jdeb how about if the input data is not yyyy/mm/dd is there anyway to convert it? thanks

Share this post


Link to post
Share on other sites

thanks jdeb how about if the input data is not yyyy/mm/dd is there anyway to convert it? thanks

Sure, i am sure that can be done ...

did you try to StringSplit the input date using SPACE an COMMA as seperators and then translate the month name to a value and put them in the right sequence ?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

thanks jdeb i never tried that i dont know how to do can you please show me a script to do it to convert Sep 27,2006 to 2006/9/27 thanks

Share this post


Link to post
Share on other sites

Something like this should work:

Global $A_Mon[13] = ["", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
$I_Date = "Sep 27,2006"
$a_Date = StringSplit($I_Date, " ,")
$Mon = 0
For $x = 1 To 12
    If $a_Date[1] = $A_Mon[$x] Then
        $Mon = StringRight("0" & $x, 2)
        ExitLoop
    EndIf
Next
$newdate = $a_Date[3] & "/" & $Mon & "/" & $a_Date[2]

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

JdeB it works great thank you so much you the man thank you again

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0