mspoula Posted February 11, 2009 Posted February 11, 2009 I cannot get my script to format the year as MM/DD/YY with autoit. Everything wants to give the full YYYY. THe program I am putting a date into requires the last two digits of the year. Thanks,
Manjish Posted February 11, 2009 Posted February 11, 2009 use ths msgbox(4096,"",StringRight(@YEAR,2)) [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
mspoula Posted February 11, 2009 Author Posted February 11, 2009 found the answer. $date = "20/01/2009" MsgBox (0, $date & "(dd/mm/yyyy)", _EditDate ($date) & " (yy-mm-dd)") Func _EditDate ($datestr) $sD = StringSplit ($datestr, "/") $day = StringRight ($sD[1], 2) $month = StringRight ($sD[2], 2) $year = StringRight ($sD[3], 2) Return $year & "-" & $month & "-" & $day EndFunc
Proph Posted February 11, 2009 Posted February 11, 2009 use ths msgbox(4096,"",StringRight(@YEAR,2)) Manjish's example is much easier then your alternative. $Date = @MONTH & "/" & @MDAY & "/" @ StringRight(@YEAR, 2)
mspoula Posted February 11, 2009 Author Posted February 11, 2009 Manjish's example is much easier then your alternative. $Date = @MONTH & "/" & @MDAY & "/" @ StringRight(@YEAR, 2) AGREED I found it before reading his post. Thanks for the help.
Manjish Posted February 11, 2009 Posted February 11, 2009 shall we close this then?? [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now